From 9912278ff9117f859a92db7af8ab5ec229e58f98 Mon Sep 17 00:00:00 2001 From: danaelhe <42972711+danaelhe@users.noreply.github.com> Date: Tue, 28 May 2024 16:33:35 -0400 Subject: [PATCH] Update autorest.python to 6.13.16 (#293) * Update Autorest to 6.13.16 * lint fix * lint * fix mocked-tests * bring python down to 3.8 * poetry lock * re-generate --- Makefile | 2 +- poetry.lock | 1786 +- pyproject.toml | 2 +- src/pydo/__init__.py | 8 +- src/pydo/_client.py | 109 +- src/pydo/_configuration.py | 16 +- src/pydo/_serialization.py | 305 +- src/pydo/_vendor.py | 17 - src/pydo/_version.py | 2 +- src/pydo/aio/__init__.py | 8 +- src/pydo/aio/_client.py | 100 +- src/pydo/aio/_configuration.py | 15 +- src/pydo/aio/operations/__init__.py | 4 +- src/pydo/aio/operations/_operations.py | 92570 ++++++++++--------- src/pydo/operations/__init__.py | 4 +- src/pydo/operations/_operations.py | 68643 ++++++++------ tests/integration/shared.py | 39 +- tests/mocked/test_client_customizations.py | 8 +- 18 files changed, 89886 insertions(+), 73752 deletions(-) delete mode 100644 src/pydo/_vendor.py diff --git a/Makefile b/Makefile index e738de11..ca476035 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ LOCAL_SPEC_FILE=./DigitalOcean-public.v2.yaml MODELERFOUR_VERSION="4.23.6" -AUTOREST_PYTHON_VERSION="6.0.1" +AUTOREST_PYTHON_VERSION="6.13.16" POETRY_VERSION:=$(shell poetry version) PACKAGE_VERSION:=$(lastword $(POETRY_VERSION)) ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) diff --git a/poetry.lock b/poetry.lock index c5822c22..1b1af36d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,128 +1,114 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiohttp" -version = "3.8.5" +version = "3.9.5" description = "Async http client/server framework (asyncio)" optional = false -python-versions = ">=3.6" -files = [ - {file = "aiohttp-3.8.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a94159871304770da4dd371f4291b20cac04e8c94f11bdea1c3478e557fbe0d8"}, - {file = "aiohttp-3.8.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:13bf85afc99ce6f9ee3567b04501f18f9f8dbbb2ea11ed1a2e079670403a7c84"}, - {file = "aiohttp-3.8.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2ce2ac5708501afc4847221a521f7e4b245abf5178cf5ddae9d5b3856ddb2f3a"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:96943e5dcc37a6529d18766597c491798b7eb7a61d48878611298afc1fca946c"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2ad5c3c4590bb3cc28b4382f031f3783f25ec223557124c68754a2231d989e2b"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0c413c633d0512df4dc7fd2373ec06cc6a815b7b6d6c2f208ada7e9e93a5061d"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:df72ac063b97837a80d80dec8d54c241af059cc9bb42c4de68bd5b61ceb37caa"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c48c5c0271149cfe467c0ff8eb941279fd6e3f65c9a388c984e0e6cf57538e14"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:368a42363c4d70ab52c2c6420a57f190ed3dfaca6a1b19afda8165ee16416a82"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7607ec3ce4993464368505888af5beb446845a014bc676d349efec0e05085905"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:0d21c684808288a98914e5aaf2a7c6a3179d4df11d249799c32d1808e79503b5"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:312fcfbacc7880a8da0ae8b6abc6cc7d752e9caa0051a53d217a650b25e9a691"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad093e823df03bb3fd37e7dec9d4670c34f9e24aeace76808fc20a507cace825"}, - {file = "aiohttp-3.8.5-cp310-cp310-win32.whl", hash = "sha256:33279701c04351a2914e1100b62b2a7fdb9a25995c4a104259f9a5ead7ed4802"}, - {file = "aiohttp-3.8.5-cp310-cp310-win_amd64.whl", hash = "sha256:6e4a280e4b975a2e7745573e3fc9c9ba0d1194a3738ce1cbaa80626cc9b4f4df"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ae871a964e1987a943d83d6709d20ec6103ca1eaf52f7e0d36ee1b5bebb8b9b9"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:461908b2578955045efde733719d62f2b649c404189a09a632d245b445c9c975"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:72a860c215e26192379f57cae5ab12b168b75db8271f111019509a1196dfc780"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc14be025665dba6202b6a71cfcdb53210cc498e50068bc088076624471f8bb9"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8af740fc2711ad85f1a5c034a435782fbd5b5f8314c9a3ef071424a8158d7f6b"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:841cd8233cbd2111a0ef0a522ce016357c5e3aff8a8ce92bcfa14cef890d698f"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ed1c46fb119f1b59304b5ec89f834f07124cd23ae5b74288e364477641060ff"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84f8ae3e09a34f35c18fa57f015cc394bd1389bce02503fb30c394d04ee6b938"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62360cb771707cb70a6fd114b9871d20d7dd2163a0feafe43fd115cfe4fe845e"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:23fb25a9f0a1ca1f24c0a371523546366bb642397c94ab45ad3aedf2941cec6a"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:b0ba0d15164eae3d878260d4c4df859bbdc6466e9e6689c344a13334f988bb53"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:5d20003b635fc6ae3f96d7260281dfaf1894fc3aa24d1888a9b2628e97c241e5"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0175d745d9e85c40dcc51c8f88c74bfbaef9e7afeeeb9d03c37977270303064c"}, - {file = "aiohttp-3.8.5-cp311-cp311-win32.whl", hash = "sha256:2e1b1e51b0774408f091d268648e3d57f7260c1682e7d3a63cb00d22d71bb945"}, - {file = "aiohttp-3.8.5-cp311-cp311-win_amd64.whl", hash = "sha256:043d2299f6dfdc92f0ac5e995dfc56668e1587cea7f9aa9d8a78a1b6554e5755"}, - {file = "aiohttp-3.8.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cae533195e8122584ec87531d6df000ad07737eaa3c81209e85c928854d2195c"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f21e83f355643c345177a5d1d8079f9f28b5133bcd154193b799d380331d5d3"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a75ef35f2df54ad55dbf4b73fe1da96f370e51b10c91f08b19603c64004acc"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e2e9839e14dd5308ee773c97115f1e0a1cb1d75cbeeee9f33824fa5144c7634"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c44e65da1de4403d0576473e2344828ef9c4c6244d65cf4b75549bb46d40b8dd"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78d847e4cde6ecc19125ccbc9bfac4a7ab37c234dd88fbb3c5c524e8e14da543"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:c7a815258e5895d8900aec4454f38dca9aed71085f227537208057853f9d13f2"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:8b929b9bd7cd7c3939f8bcfffa92fae7480bd1aa425279d51a89327d600c704d"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:5db3a5b833764280ed7618393832e0853e40f3d3e9aa128ac0ba0f8278d08649"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:a0215ce6041d501f3155dc219712bc41252d0ab76474615b9700d63d4d9292af"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:fd1ed388ea7fbed22c4968dd64bab0198de60750a25fe8c0c9d4bef5abe13824"}, - {file = "aiohttp-3.8.5-cp36-cp36m-win32.whl", hash = "sha256:6e6783bcc45f397fdebc118d772103d751b54cddf5b60fbcc958382d7dd64f3e"}, - {file = "aiohttp-3.8.5-cp36-cp36m-win_amd64.whl", hash = "sha256:b5411d82cddd212644cf9360879eb5080f0d5f7d809d03262c50dad02f01421a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:01d4c0c874aa4ddfb8098e85d10b5e875a70adc63db91f1ae65a4b04d3344cda"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5980a746d547a6ba173fd5ee85ce9077e72d118758db05d229044b469d9029a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2a482e6da906d5e6e653be079b29bc173a48e381600161c9932d89dfae5942ef"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80bd372b8d0715c66c974cf57fe363621a02f359f1ec81cba97366948c7fc873"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1161b345c0a444ebcf46bf0a740ba5dcf50612fd3d0528883fdc0eff578006a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd56db019015b6acfaaf92e1ac40eb8434847d9bf88b4be4efe5bfd260aee692"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:153c2549f6c004d2754cc60603d4668899c9895b8a89397444a9c4efa282aaf4"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4a01951fabc4ce26ab791da5f3f24dca6d9a6f24121746eb19756416ff2d881b"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bfb9162dcf01f615462b995a516ba03e769de0789de1cadc0f916265c257e5d8"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:7dde0009408969a43b04c16cbbe252c4f5ef4574ac226bc8815cd7342d2028b6"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:4149d34c32f9638f38f544b3977a4c24052042affa895352d3636fa8bffd030a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-win32.whl", hash = "sha256:68c5a82c8779bdfc6367c967a4a1b2aa52cd3595388bf5961a62158ee8a59e22"}, - {file = "aiohttp-3.8.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2cf57fb50be5f52bda004b8893e63b48530ed9f0d6c96c84620dc92fe3cd9b9d"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:eca4bf3734c541dc4f374ad6010a68ff6c6748f00451707f39857f429ca36ced"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1274477e4c71ce8cfe6c1ec2f806d57c015ebf84d83373676036e256bc55d690"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:28c543e54710d6158fc6f439296c7865b29e0b616629767e685a7185fab4a6b9"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:910bec0c49637d213f5d9877105d26e0c4a4de2f8b1b29405ff37e9fc0ad52b8"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5443910d662db951b2e58eb70b0fbe6b6e2ae613477129a5805d0b66c54b6cb7"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e460be6978fc24e3df83193dc0cc4de46c9909ed92dd47d349a452ef49325b7"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb1558def481d84f03b45888473fc5a1f35747b5f334ef4e7a571bc0dfcb11f8"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:34dd0c107799dcbbf7d48b53be761a013c0adf5571bf50c4ecad5643fe9cfcd0"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:aa1990247f02a54185dc0dff92a6904521172a22664c863a03ff64c42f9b5410"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0e584a10f204a617d71d359fe383406305a4b595b333721fa50b867b4a0a1548"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:a3cf433f127efa43fee6b90ea4c6edf6c4a17109d1d037d1a52abec84d8f2e42"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:c11f5b099adafb18e65c2c997d57108b5bbeaa9eeee64a84302c0978b1ec948b"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:84de26ddf621d7ac4c975dbea4c945860e08cccde492269db4e1538a6a6f3c35"}, - {file = "aiohttp-3.8.5-cp38-cp38-win32.whl", hash = "sha256:ab88bafedc57dd0aab55fa728ea10c1911f7e4d8b43e1d838a1739f33712921c"}, - {file = "aiohttp-3.8.5-cp38-cp38-win_amd64.whl", hash = "sha256:5798a9aad1879f626589f3df0f8b79b3608a92e9beab10e5fda02c8a2c60db2e"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a6ce61195c6a19c785df04e71a4537e29eaa2c50fe745b732aa937c0c77169f3"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:773dd01706d4db536335fcfae6ea2440a70ceb03dd3e7378f3e815b03c97ab51"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f83a552443a526ea38d064588613aca983d0ee0038801bc93c0c916428310c28"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f7372f7341fcc16f57b2caded43e81ddd18df53320b6f9f042acad41f8e049a"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea353162f249c8097ea63c2169dd1aa55de1e8fecbe63412a9bc50816e87b761"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5d47ae48db0b2dcf70bc8a3bc72b3de86e2a590fc299fdbbb15af320d2659de"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d827176898a2b0b09694fbd1088c7a31836d1a505c243811c87ae53a3f6273c1"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3562b06567c06439d8b447037bb655ef69786c590b1de86c7ab81efe1c9c15d8"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4e874cbf8caf8959d2adf572a78bba17cb0e9d7e51bb83d86a3697b686a0ab4d"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6809a00deaf3810e38c628e9a33271892f815b853605a936e2e9e5129762356c"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:33776e945d89b29251b33a7e7d006ce86447b2cfd66db5e5ded4e5cd0340585c"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:eaeed7abfb5d64c539e2db173f63631455f1196c37d9d8d873fc316470dfbacd"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e91d635961bec2d8f19dfeb41a539eb94bd073f075ca6dae6c8dc0ee89ad6f91"}, - {file = "aiohttp-3.8.5-cp39-cp39-win32.whl", hash = "sha256:00ad4b6f185ec67f3e6562e8a1d2b69660be43070bd0ef6fcec5211154c7df67"}, - {file = "aiohttp-3.8.5-cp39-cp39-win_amd64.whl", hash = "sha256:c0a9034379a37ae42dea7ac1e048352d96286626251862e448933c0f59cbd79c"}, - {file = "aiohttp-3.8.5.tar.gz", hash = "sha256:b9552ec52cc147dbf1944ac7ac98af7602e51ea2dcd076ed194ca3c0d1c7d0bc"}, +python-versions = ">=3.8" +files = [ + {file = "aiohttp-3.9.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fcde4c397f673fdec23e6b05ebf8d4751314fa7c24f93334bf1f1364c1c69ac7"}, + {file = "aiohttp-3.9.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5d6b3f1fabe465e819aed2c421a6743d8debbde79b6a8600739300630a01bf2c"}, + {file = "aiohttp-3.9.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6ae79c1bc12c34082d92bf9422764f799aee4746fd7a392db46b7fd357d4a17a"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4d3ebb9e1316ec74277d19c5f482f98cc65a73ccd5430540d6d11682cd857430"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84dabd95154f43a2ea80deffec9cb44d2e301e38a0c9d331cc4aa0166fe28ae3"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c8a02fbeca6f63cb1f0475c799679057fc9268b77075ab7cf3f1c600e81dd46b"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c26959ca7b75ff768e2776d8055bf9582a6267e24556bb7f7bd29e677932be72"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:714d4e5231fed4ba2762ed489b4aec07b2b9953cf4ee31e9871caac895a839c0"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e7a6a8354f1b62e15d48e04350f13e726fa08b62c3d7b8401c0a1314f02e3558"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:c413016880e03e69d166efb5a1a95d40f83d5a3a648d16486592c49ffb76d0db"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:ff84aeb864e0fac81f676be9f4685f0527b660f1efdc40dcede3c251ef1e867f"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ad7f2919d7dac062f24d6f5fe95d401597fbb015a25771f85e692d043c9d7832"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:702e2c7c187c1a498a4e2b03155d52658fdd6fda882d3d7fbb891a5cf108bb10"}, + {file = "aiohttp-3.9.5-cp310-cp310-win32.whl", hash = "sha256:67c3119f5ddc7261d47163ed86d760ddf0e625cd6246b4ed852e82159617b5fb"}, + {file = "aiohttp-3.9.5-cp310-cp310-win_amd64.whl", hash = "sha256:471f0ef53ccedec9995287f02caf0c068732f026455f07db3f01a46e49d76bbb"}, + {file = "aiohttp-3.9.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:e0ae53e33ee7476dd3d1132f932eeb39bf6125083820049d06edcdca4381f342"}, + {file = "aiohttp-3.9.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c088c4d70d21f8ca5c0b8b5403fe84a7bc8e024161febdd4ef04575ef35d474d"}, + {file = "aiohttp-3.9.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:639d0042b7670222f33b0028de6b4e2fad6451462ce7df2af8aee37dcac55424"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f26383adb94da5e7fb388d441bf09c61e5e35f455a3217bfd790c6b6bc64b2ee"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:66331d00fb28dc90aa606d9a54304af76b335ae204d1836f65797d6fe27f1ca2"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ff550491f5492ab5ed3533e76b8567f4b37bd2995e780a1f46bca2024223233"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f22eb3a6c1080d862befa0a89c380b4dafce29dc6cd56083f630073d102eb595"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a81b1143d42b66ffc40a441379387076243ef7b51019204fd3ec36b9f69e77d6"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:f64fd07515dad67f24b6ea4a66ae2876c01031de91c93075b8093f07c0a2d93d"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:93e22add827447d2e26d67c9ac0161756007f152fdc5210277d00a85f6c92323"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:55b39c8684a46e56ef8c8d24faf02de4a2b2ac60d26cee93bc595651ff545de9"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4715a9b778f4293b9f8ae7a0a7cef9829f02ff8d6277a39d7f40565c737d3771"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:afc52b8d969eff14e069a710057d15ab9ac17cd4b6753042c407dcea0e40bf75"}, + {file = "aiohttp-3.9.5-cp311-cp311-win32.whl", hash = "sha256:b3df71da99c98534be076196791adca8819761f0bf6e08e07fd7da25127150d6"}, + {file = "aiohttp-3.9.5-cp311-cp311-win_amd64.whl", hash = "sha256:88e311d98cc0bf45b62fc46c66753a83445f5ab20038bcc1b8a1cc05666f428a"}, + {file = "aiohttp-3.9.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:c7a4b7a6cf5b6eb11e109a9755fd4fda7d57395f8c575e166d363b9fc3ec4678"}, + {file = "aiohttp-3.9.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:0a158704edf0abcac8ac371fbb54044f3270bdbc93e254a82b6c82be1ef08f3c"}, + {file = "aiohttp-3.9.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d153f652a687a8e95ad367a86a61e8d53d528b0530ef382ec5aaf533140ed00f"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82a6a97d9771cb48ae16979c3a3a9a18b600a8505b1115cfe354dfb2054468b4"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:60cdbd56f4cad9f69c35eaac0fbbdf1f77b0ff9456cebd4902f3dd1cf096464c"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8676e8fd73141ded15ea586de0b7cda1542960a7b9ad89b2b06428e97125d4fa"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da00da442a0e31f1c69d26d224e1efd3a1ca5bcbf210978a2ca7426dfcae9f58"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18f634d540dd099c262e9f887c8bbacc959847cfe5da7a0e2e1cf3f14dbf2daf"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:320e8618eda64e19d11bdb3bd04ccc0a816c17eaecb7e4945d01deee2a22f95f"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:2faa61a904b83142747fc6a6d7ad8fccff898c849123030f8e75d5d967fd4a81"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:8c64a6dc3fe5db7b1b4d2b5cb84c4f677768bdc340611eca673afb7cf416ef5a"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:393c7aba2b55559ef7ab791c94b44f7482a07bf7640d17b341b79081f5e5cd1a"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c671dc117c2c21a1ca10c116cfcd6e3e44da7fcde37bf83b2be485ab377b25da"}, + {file = "aiohttp-3.9.5-cp312-cp312-win32.whl", hash = "sha256:5a7ee16aab26e76add4afc45e8f8206c95d1d75540f1039b84a03c3b3800dd59"}, + {file = "aiohttp-3.9.5-cp312-cp312-win_amd64.whl", hash = "sha256:5ca51eadbd67045396bc92a4345d1790b7301c14d1848feaac1d6a6c9289e888"}, + {file = "aiohttp-3.9.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:694d828b5c41255e54bc2dddb51a9f5150b4eefa9886e38b52605a05d96566e8"}, + {file = "aiohttp-3.9.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0605cc2c0088fcaae79f01c913a38611ad09ba68ff482402d3410bf59039bfb8"}, + {file = "aiohttp-3.9.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4558e5012ee03d2638c681e156461d37b7a113fe13970d438d95d10173d25f78"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dbc053ac75ccc63dc3a3cc547b98c7258ec35a215a92bd9f983e0aac95d3d5b"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4109adee842b90671f1b689901b948f347325045c15f46b39797ae1bf17019de"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6ea1a5b409a85477fd8e5ee6ad8f0e40bf2844c270955e09360418cfd09abac"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3c2890ca8c59ee683fd09adf32321a40fe1cf164e3387799efb2acebf090c11"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3916c8692dbd9d55c523374a3b8213e628424d19116ac4308e434dbf6d95bbdd"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8d1964eb7617907c792ca00b341b5ec3e01ae8c280825deadbbd678447b127e1"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d5ab8e1f6bee051a4bf6195e38a5c13e5e161cb7bad83d8854524798bd9fcd6e"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:52c27110f3862a1afbcb2af4281fc9fdc40327fa286c4625dfee247c3ba90156"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:7f64cbd44443e80094309875d4f9c71d0401e966d191c3d469cde4642bc2e031"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8b4f72fbb66279624bfe83fd5eb6aea0022dad8eec62b71e7bf63ee1caadeafe"}, + {file = "aiohttp-3.9.5-cp38-cp38-win32.whl", hash = "sha256:6380c039ec52866c06d69b5c7aad5478b24ed11696f0e72f6b807cfb261453da"}, + {file = "aiohttp-3.9.5-cp38-cp38-win_amd64.whl", hash = "sha256:da22dab31d7180f8c3ac7c7635f3bcd53808f374f6aa333fe0b0b9e14b01f91a"}, + {file = "aiohttp-3.9.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1732102949ff6087589408d76cd6dea656b93c896b011ecafff418c9661dc4ed"}, + {file = "aiohttp-3.9.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c6021d296318cb6f9414b48e6a439a7f5d1f665464da507e8ff640848ee2a58a"}, + {file = "aiohttp-3.9.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:239f975589a944eeb1bad26b8b140a59a3a320067fb3cd10b75c3092405a1372"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3b7b30258348082826d274504fbc7c849959f1989d86c29bc355107accec6cfb"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cd2adf5c87ff6d8b277814a28a535b59e20bfea40a101db6b3bdca7e9926bc24"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e9a3d838441bebcf5cf442700e3963f58b5c33f015341f9ea86dcd7d503c07e2"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e3a1ae66e3d0c17cf65c08968a5ee3180c5a95920ec2731f53343fac9bad106"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9c69e77370cce2d6df5d12b4e12bdcca60c47ba13d1cbbc8645dd005a20b738b"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0cbf56238f4bbf49dab8c2dc2e6b1b68502b1e88d335bea59b3f5b9f4c001475"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:d1469f228cd9ffddd396d9948b8c9cd8022b6d1bf1e40c6f25b0fb90b4f893ed"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:45731330e754f5811c314901cebdf19dd776a44b31927fa4b4dbecab9e457b0c"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:3fcb4046d2904378e3aeea1df51f697b0467f2aac55d232c87ba162709478c46"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8cf142aa6c1a751fcb364158fd710b8a9be874b81889c2bd13aa8893197455e2"}, + {file = "aiohttp-3.9.5-cp39-cp39-win32.whl", hash = "sha256:7b179eea70833c8dee51ec42f3b4097bd6370892fa93f510f76762105568cf09"}, + {file = "aiohttp-3.9.5-cp39-cp39-win_amd64.whl", hash = "sha256:38d80498e2e169bc61418ff36170e0aad0cd268da8b38a17c4cf29d254a8b3f1"}, + {file = "aiohttp-3.9.5.tar.gz", hash = "sha256:edea7d15772ceeb29db4aff55e482d4bcfb6ae160ce144f2682de02f6d693551"}, ] [package.dependencies] aiosignal = ">=1.1.2" -async-timeout = ">=4.0.0a3,<5.0" -asynctest = {version = "0.13.0", markers = "python_version < \"3.8\""} +async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} attrs = ">=17.3.0" -charset-normalizer = ">=2.0,<4.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" -typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} yarl = ">=1.0,<2.0" [package.extras] -speedups = ["Brotli", "aiodns", "cchardet"] +speedups = ["Brotli", "aiodns", "brotlicffi"] [[package]] name = "aioresponses" -version = "0.7.3" +version = "0.7.6" description = "Mock out requests made by ClientSession from aiohttp package" optional = false python-versions = "*" files = [ - {file = "aioresponses-0.7.3-py2.py3-none-any.whl", hash = "sha256:7b1897169062c92fa87d6ecc503ac566ac87fbfacb2504f8ca81c8035a2eb068"}, - {file = "aioresponses-0.7.3.tar.gz", hash = "sha256:2c64ed5710ee8cb4e958c569184dad12f4c9cd5939135cb38f88c6a8261cceb3"}, + {file = "aioresponses-0.7.6-py2.py3-none-any.whl", hash = "sha256:d2c26defbb9b440ea2685ec132e90700907fd10bcca3e85ec2f157219f0d26f7"}, + {file = "aioresponses-0.7.6.tar.gz", hash = "sha256:f795d9dbda2d61774840e7e32f5366f45752d1adc1b74c9362afd017296c7ee1"}, ] [package.dependencies] -aiohttp = ">=2.0.0,<4.0.0" +aiohttp = ">=3.3.0,<4.0.0" [[package]] name = "aiosignal" @@ -140,30 +126,29 @@ frozenlist = ">=1.1.0" [[package]] name = "alabaster" -version = "0.7.12" +version = "0.7.13" description = "A configurable sidebar-enabled Sphinx theme" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "alabaster-0.7.12-py2.py3-none-any.whl", hash = "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359"}, - {file = "alabaster-0.7.12.tar.gz", hash = "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"}, + {file = "alabaster-0.7.13-py3-none-any.whl", hash = "sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3"}, + {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, ] [[package]] name = "astroid" -version = "2.12.12" +version = "2.15.8" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.7.2" files = [ - {file = "astroid-2.12.12-py3-none-any.whl", hash = "sha256:72702205200b2a638358369d90c222d74ebc376787af8fb2f7f2a86f7b5cc85f"}, - {file = "astroid-2.12.12.tar.gz", hash = "sha256:1c00a14f5a3ed0339d38d2e2e5b74ea2591df5861c0936bb292b84ccf3a78d83"}, + {file = "astroid-2.15.8-py3-none-any.whl", hash = "sha256:1aa149fc5c6589e3d0ece885b4491acd80af4f087baafa3fb5203b113e68cd3c"}, + {file = "astroid-2.15.8.tar.gz", hash = "sha256:6c107453dffee9055899705de3c9ead36e74119cee151e5a9aaf7f0b0e020a6a"}, ] [package.dependencies] lazy-object-proxy = ">=1.4.0" -typed-ast = {version = ">=1.4.0,<2.0", markers = "implementation_name == \"cpython\" and python_version < \"3.8\""} -typing-extensions = {version = ">=3.10", markers = "python_version < \"3.10\""} +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} wrapt = [ {version = ">=1.11,<2", markers = "python_version < \"3.11\""}, {version = ">=1.14,<2", markers = "python_version >= \"3.11\""}, @@ -171,125 +156,106 @@ wrapt = [ [[package]] name = "async-timeout" -version = "4.0.2" +version = "4.0.3" description = "Timeout context manager for asyncio programs" optional = false -python-versions = ">=3.6" -files = [ - {file = "async-timeout-4.0.2.tar.gz", hash = "sha256:2163e1640ddb52b7a8c80d0a67a08587e5d245cc9c553a74a847056bc2976b15"}, - {file = "async_timeout-4.0.2-py3-none-any.whl", hash = "sha256:8ca1e4fcf50d07413d66d1a5e416e42cfdf5851c981d679a09851a6853383b3c"}, -] - -[package.dependencies] -typing-extensions = {version = ">=3.6.5", markers = "python_version < \"3.8\""} - -[[package]] -name = "asynctest" -version = "0.13.0" -description = "Enhance the standard unittest package with features for testing asyncio libraries" -optional = false -python-versions = ">=3.5" +python-versions = ">=3.7" files = [ - {file = "asynctest-0.13.0-py3-none-any.whl", hash = "sha256:5da6118a7e6d6b54d83a8f7197769d046922a44d2a99c21382f0a6e4fadae676"}, - {file = "asynctest-0.13.0.tar.gz", hash = "sha256:c27862842d15d83e6a34eb0b2866c323880eb3a75e4485b079ea11748fd77fac"}, + {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, + {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, ] [[package]] name = "attrs" -version = "22.1.0" +version = "23.2.0" description = "Classes Without Boilerplate" optional = false -python-versions = ">=3.5" +python-versions = ">=3.7" files = [ - {file = "attrs-22.1.0-py2.py3-none-any.whl", hash = "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"}, - {file = "attrs-22.1.0.tar.gz", hash = "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"}, + {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, + {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, ] [package.extras] -dev = ["cloudpickle", "coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy (>=0.900,!=0.940)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "sphinx", "sphinx-notfound-page", "zope.interface"] -docs = ["furo", "sphinx", "sphinx-notfound-page", "zope.interface"] -tests = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "zope.interface"] -tests-no-zope = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins"] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-mypy = ["mypy (>=1.6)", "pytest-mypy-plugins"] +tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist[psutil]"] [[package]] name = "azure-core" -version = "1.26.1" +version = "1.30.1" description = "Microsoft Azure Core Library for Python" optional = false python-versions = ">=3.7" files = [ - {file = "azure-core-1.26.1.zip", hash = "sha256:223b0e90cbdd1f03c41b195b03239899843f20d00964dbb85e64386873414a2d"}, - {file = "azure_core-1.26.1-py3-none-any.whl", hash = "sha256:726ffd1ded04a2c1cb53f9d9155cbb05ac5c1c2a29af4ef622e93e1c0a8bc92b"}, + {file = "azure-core-1.30.1.tar.gz", hash = "sha256:26273a254131f84269e8ea4464f3560c731f29c0c1f69ac99010845f239c1a8f"}, + {file = "azure_core-1.30.1-py3-none-any.whl", hash = "sha256:7c5ee397e48f281ec4dd773d67a0a47a0962ed6fa833036057f9ea067f688e74"}, ] [package.dependencies] -requests = ">=2.18.4" +requests = ">=2.21.0" six = ">=1.11.0" -typing-extensions = ">=4.0.1" +typing-extensions = ">=4.6.0" [package.extras] aio = ["aiohttp (>=3.0)"] [[package]] name = "azure-identity" -version = "1.12.0" +version = "1.16.0" description = "Microsoft Azure Identity Library for Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "azure-identity-1.12.0.zip", hash = "sha256:7f9b1ae7d97ea7af3f38dd09305e19ab81a1e16ab66ea186b6579d85c1ca2347"}, - {file = "azure_identity-1.12.0-py3-none-any.whl", hash = "sha256:2a58ce4a209a013e37eaccfd5937570ab99e9118b3e1acf875eed3a85d541b92"}, + {file = "azure-identity-1.16.0.tar.gz", hash = "sha256:6ff1d667cdcd81da1ceab42f80a0be63ca846629f518a922f7317a7e3c844e1b"}, + {file = "azure_identity-1.16.0-py3-none-any.whl", hash = "sha256:722fdb60b8fdd55fa44dc378b8072f4b419b56a5e54c0de391f644949f3a826f"}, ] [package.dependencies] -azure-core = ">=1.11.0,<2.0.0" +azure-core = ">=1.23.0" cryptography = ">=2.5" -msal = ">=1.12.0,<2.0.0" -msal-extensions = ">=0.3.0,<2.0.0" -six = ">=1.12.0" +msal = ">=1.24.0" +msal-extensions = ">=0.3.0" [[package]] name = "babel" -version = "2.11.0" +version = "2.15.0" description = "Internationalization utilities" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "Babel-2.11.0-py3-none-any.whl", hash = "sha256:1ad3eca1c885218f6dce2ab67291178944f810a10a9b5f3cb8382a5a232b64fe"}, - {file = "Babel-2.11.0.tar.gz", hash = "sha256:5ef4b3226b0180dedded4229651c8b0e1a3a6a2837d45a073272f313e4cf97f6"}, + {file = "Babel-2.15.0-py3-none-any.whl", hash = "sha256:08706bdad8d0a3413266ab61bd6c34d0c28d6e1e7badf40a2cebe67644e2e1fb"}, + {file = "babel-2.15.0.tar.gz", hash = "sha256:8daf0e265d05768bc6c7a314cf1321e9a123afc328cc635c18622a2f30a04413"}, ] [package.dependencies] -pytz = ">=2015.7" +pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} + +[package.extras] +dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] [[package]] name = "black" -version = "22.10.0" +version = "22.12.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.7" files = [ - {file = "black-22.10.0-1fixedarch-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:5cc42ca67989e9c3cf859e84c2bf014f6633db63d1cbdf8fdb666dcd9e77e3fa"}, - {file = "black-22.10.0-1fixedarch-cp311-cp311-macosx_11_0_x86_64.whl", hash = "sha256:5d8f74030e67087b219b032aa33a919fae8806d49c867846bfacde57f43972ef"}, - {file = "black-22.10.0-1fixedarch-cp37-cp37m-macosx_10_16_x86_64.whl", hash = "sha256:197df8509263b0b8614e1df1756b1dd41be6738eed2ba9e9769f3880c2b9d7b6"}, - {file = "black-22.10.0-1fixedarch-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:2644b5d63633702bc2c5f3754b1b475378fbbfb481f62319388235d0cd104c2d"}, - {file = "black-22.10.0-1fixedarch-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:e41a86c6c650bcecc6633ee3180d80a025db041a8e2398dcc059b3afa8382cd4"}, - {file = "black-22.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2039230db3c6c639bd84efe3292ec7b06e9214a2992cd9beb293d639c6402edb"}, - {file = "black-22.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14ff67aec0a47c424bc99b71005202045dc09270da44a27848d534600ac64fc7"}, - {file = "black-22.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:819dc789f4498ecc91438a7de64427c73b45035e2e3680c92e18795a839ebb66"}, - {file = "black-22.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5b9b29da4f564ba8787c119f37d174f2b69cdfdf9015b7d8c5c16121ddc054ae"}, - {file = "black-22.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8b49776299fece66bffaafe357d929ca9451450f5466e997a7285ab0fe28e3b"}, - {file = "black-22.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:21199526696b8f09c3997e2b4db8d0b108d801a348414264d2eb8eb2532e540d"}, - {file = "black-22.10.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e464456d24e23d11fced2bc8c47ef66d471f845c7b7a42f3bd77bf3d1789650"}, - {file = "black-22.10.0-cp37-cp37m-win_amd64.whl", hash = "sha256:9311e99228ae10023300ecac05be5a296f60d2fd10fff31cf5c1fa4ca4b1988d"}, - {file = "black-22.10.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:fba8a281e570adafb79f7755ac8721b6cf1bbf691186a287e990c7929c7692ff"}, - {file = "black-22.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:915ace4ff03fdfff953962fa672d44be269deb2eaf88499a0f8805221bc68c87"}, - {file = "black-22.10.0-cp38-cp38-win_amd64.whl", hash = "sha256:444ebfb4e441254e87bad00c661fe32df9969b2bf224373a448d8aca2132b395"}, - {file = "black-22.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:974308c58d057a651d182208a484ce80a26dac0caef2895836a92dd6ebd725e0"}, - {file = "black-22.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72ef3925f30e12a184889aac03d77d031056860ccae8a1e519f6cbb742736383"}, - {file = "black-22.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:432247333090c8c5366e69627ccb363bc58514ae3e63f7fc75c54b1ea80fa7de"}, - {file = "black-22.10.0-py3-none-any.whl", hash = "sha256:c957b2b4ea88587b46cf49d1dc17681c1e672864fd7af32fc1e9664d572b3458"}, - {file = "black-22.10.0.tar.gz", hash = "sha256:f513588da599943e0cde4e32cc9879e825d58720d6557062d1098c5ad80080e1"}, + {file = "black-22.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eedd20838bd5d75b80c9f5487dbcb06836a43833a37846cf1d8c1cc01cef59d"}, + {file = "black-22.12.0-cp310-cp310-win_amd64.whl", hash = "sha256:159a46a4947f73387b4d83e87ea006dbb2337eab6c879620a3ba52699b1f4351"}, + {file = "black-22.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d30b212bffeb1e252b31dd269dfae69dd17e06d92b87ad26e23890f3efea366f"}, + {file = "black-22.12.0-cp311-cp311-win_amd64.whl", hash = "sha256:7412e75863aa5c5411886804678b7d083c7c28421210180d67dfd8cf1221e1f4"}, + {file = "black-22.12.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c116eed0efb9ff870ded8b62fe9f28dd61ef6e9ddd28d83d7d264a38417dcee2"}, + {file = "black-22.12.0-cp37-cp37m-win_amd64.whl", hash = "sha256:1f58cbe16dfe8c12b7434e50ff889fa479072096d79f0a7f25e4ab8e94cd8350"}, + {file = "black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:77d86c9f3db9b1bf6761244bc0b3572a546f5fe37917a044e02f3166d5aafa7d"}, + {file = "black-22.12.0-cp38-cp38-win_amd64.whl", hash = "sha256:82d9fe8fee3401e02e79767016b4907820a7dc28d70d137eb397b92ef3cc5bfc"}, + {file = "black-22.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:101c69b23df9b44247bd88e1d7e90154336ac4992502d4197bdac35dd7ee3320"}, + {file = "black-22.12.0-cp39-cp39-win_amd64.whl", hash = "sha256:559c7a1ba9a006226f09e4916060982fd27334ae1998e7a38b3f33a37f7a2148"}, + {file = "black-22.12.0-py3-none-any.whl", hash = "sha256:436cc9167dd28040ad90d3b404aec22cedf24a6e4d7de221bec2730ec0c97bcf"}, + {file = "black-22.12.0.tar.gz", hash = "sha256:229351e5a18ca30f447bf724d007f890f97e13af070bb6ad4c0a441cd7596a2f"}, ] [package.dependencies] @@ -298,7 +264,6 @@ mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} -typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] @@ -309,86 +274,74 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "certifi" -version = "2023.7.22" +version = "2024.2.2" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, - {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, + {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, + {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, ] [[package]] name = "cffi" -version = "1.15.1" +version = "1.16.0" description = "Foreign Function Interface for Python calling C code." optional = false -python-versions = "*" -files = [ - {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"}, - {file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"}, - {file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"}, - {file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"}, - {file = "cffi-1.15.1-cp27-cp27m-win_amd64.whl", hash = "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e"}, - {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162"}, - {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b"}, - {file = "cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21"}, - {file = "cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4"}, - {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01"}, - {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e"}, - {file = "cffi-1.15.1-cp310-cp310-win32.whl", hash = "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2"}, - {file = "cffi-1.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d"}, - {file = "cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac"}, - {file = "cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c"}, - {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef"}, - {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8"}, - {file = "cffi-1.15.1-cp311-cp311-win32.whl", hash = "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d"}, - {file = "cffi-1.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104"}, - {file = "cffi-1.15.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e"}, - {file = "cffi-1.15.1-cp36-cp36m-win32.whl", hash = "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf"}, - {file = "cffi-1.15.1-cp36-cp36m-win_amd64.whl", hash = "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497"}, - {file = "cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426"}, - {file = "cffi-1.15.1-cp37-cp37m-win32.whl", hash = "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9"}, - {file = "cffi-1.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045"}, - {file = "cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192"}, - {file = "cffi-1.15.1-cp38-cp38-win32.whl", hash = "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314"}, - {file = "cffi-1.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5"}, - {file = "cffi-1.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585"}, - {file = "cffi-1.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27"}, - {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76"}, - {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3"}, - {file = "cffi-1.15.1-cp39-cp39-win32.whl", hash = "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee"}, - {file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"}, - {file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"}, +python-versions = ">=3.8" +files = [ + {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, + {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614"}, + {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743"}, + {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d"}, + {file = "cffi-1.16.0-cp310-cp310-win32.whl", hash = "sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a"}, + {file = "cffi-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1"}, + {file = "cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404"}, + {file = "cffi-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e"}, + {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc"}, + {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb"}, + {file = "cffi-1.16.0-cp311-cp311-win32.whl", hash = "sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab"}, + {file = "cffi-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba"}, + {file = "cffi-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956"}, + {file = "cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969"}, + {file = "cffi-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520"}, + {file = "cffi-1.16.0-cp312-cp312-win32.whl", hash = "sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b"}, + {file = "cffi-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235"}, + {file = "cffi-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324"}, + {file = "cffi-1.16.0-cp38-cp38-win32.whl", hash = "sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a"}, + {file = "cffi-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36"}, + {file = "cffi-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed"}, + {file = "cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098"}, + {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000"}, + {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe"}, + {file = "cffi-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4"}, + {file = "cffi-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8"}, + {file = "cffi-1.16.0.tar.gz", hash = "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"}, ] [package.dependencies] @@ -396,32 +349,116 @@ pycparser = "*" [[package]] name = "charset-normalizer" -version = "2.1.1" +version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false -python-versions = ">=3.6.0" -files = [ - {file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"}, - {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, + {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, ] -[package.extras] -unicode-backport = ["unicodedata2"] - [[package]] name = "click" -version = "8.1.3" +version = "8.1.7" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" files = [ - {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, - {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, ] [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "colorama" @@ -436,43 +473,43 @@ files = [ [[package]] name = "cryptography" -version = "42.0.4" +version = "42.0.7" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-42.0.4-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:ffc73996c4fca3d2b6c1c8c12bfd3ad00def8621da24f547626bf06441400449"}, - {file = "cryptography-42.0.4-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:db4b65b02f59035037fde0998974d84244a64c3265bdef32a827ab9b63d61b18"}, - {file = "cryptography-42.0.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad9c385ba8ee025bb0d856714f71d7840020fe176ae0229de618f14dae7a6e2"}, - {file = "cryptography-42.0.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:69b22ab6506a3fe483d67d1ed878e1602bdd5912a134e6202c1ec672233241c1"}, - {file = "cryptography-42.0.4-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:e09469a2cec88fb7b078e16d4adec594414397e8879a4341c6ace96013463d5b"}, - {file = "cryptography-42.0.4-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3e970a2119507d0b104f0a8e281521ad28fc26f2820687b3436b8c9a5fcf20d1"}, - {file = "cryptography-42.0.4-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:e53dc41cda40b248ebc40b83b31516487f7db95ab8ceac1f042626bc43a2f992"}, - {file = "cryptography-42.0.4-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:c3a5cbc620e1e17009f30dd34cb0d85c987afd21c41a74352d1719be33380885"}, - {file = "cryptography-42.0.4-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6bfadd884e7280df24d26f2186e4e07556a05d37393b0f220a840b083dc6a824"}, - {file = "cryptography-42.0.4-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:01911714117642a3f1792c7f376db572aadadbafcd8d75bb527166009c9f1d1b"}, - {file = "cryptography-42.0.4-cp37-abi3-win32.whl", hash = "sha256:fb0cef872d8193e487fc6bdb08559c3aa41b659a7d9be48b2e10747f47863925"}, - {file = "cryptography-42.0.4-cp37-abi3-win_amd64.whl", hash = "sha256:c1f25b252d2c87088abc8bbc4f1ecbf7c919e05508a7e8628e6875c40bc70923"}, - {file = "cryptography-42.0.4-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:15a1fb843c48b4a604663fa30af60818cd28f895572386e5f9b8a665874c26e7"}, - {file = "cryptography-42.0.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1327f280c824ff7885bdeef8578f74690e9079267c1c8bd7dc5cc5aa065ae52"}, - {file = "cryptography-42.0.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ffb03d419edcab93b4b19c22ee80c007fb2d708429cecebf1dd3258956a563a"}, - {file = "cryptography-42.0.4-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:1df6fcbf60560d2113b5ed90f072dc0b108d64750d4cbd46a21ec882c7aefce9"}, - {file = "cryptography-42.0.4-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:44a64043f743485925d3bcac548d05df0f9bb445c5fcca6681889c7c3ab12764"}, - {file = "cryptography-42.0.4-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:3c6048f217533d89f2f8f4f0fe3044bf0b2090453b7b73d0b77db47b80af8dff"}, - {file = "cryptography-42.0.4-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:6d0fbe73728c44ca3a241eff9aefe6496ab2656d6e7a4ea2459865f2e8613257"}, - {file = "cryptography-42.0.4-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:887623fe0d70f48ab3f5e4dbf234986b1329a64c066d719432d0698522749929"}, - {file = "cryptography-42.0.4-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ce8613beaffc7c14f091497346ef117c1798c202b01153a8cc7b8e2ebaaf41c0"}, - {file = "cryptography-42.0.4-cp39-abi3-win32.whl", hash = "sha256:810bcf151caefc03e51a3d61e53335cd5c7316c0a105cc695f0959f2c638b129"}, - {file = "cryptography-42.0.4-cp39-abi3-win_amd64.whl", hash = "sha256:a0298bdc6e98ca21382afe914c642620370ce0470a01e1bef6dd9b5354c36854"}, - {file = "cryptography-42.0.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5f8907fcf57392cd917892ae83708761c6ff3c37a8e835d7246ff0ad251d9298"}, - {file = "cryptography-42.0.4-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:12d341bd42cdb7d4937b0cabbdf2a94f949413ac4504904d0cdbdce4a22cbf88"}, - {file = "cryptography-42.0.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1cdcdbd117681c88d717437ada72bdd5be9de117f96e3f4d50dab3f59fd9ab20"}, - {file = "cryptography-42.0.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:0e89f7b84f421c56e7ff69f11c441ebda73b8a8e6488d322ef71746224c20fce"}, - {file = "cryptography-42.0.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f1e85a178384bf19e36779d91ff35c7617c885da487d689b05c1366f9933ad74"}, - {file = "cryptography-42.0.4-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d2a27aca5597c8a71abbe10209184e1a8e91c1fd470b5070a2ea60cafec35bcd"}, - {file = "cryptography-42.0.4-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4e36685cb634af55e0677d435d425043967ac2f3790ec652b2b88ad03b85c27b"}, - {file = "cryptography-42.0.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:f47be41843200f7faec0683ad751e5ef11b9a56a220d57f300376cd8aba81660"}, - {file = "cryptography-42.0.4.tar.gz", hash = "sha256:831a4b37accef30cccd34fcb916a5d7b5be3cbbe27268a02832c3e450aea39cb"}, + {file = "cryptography-42.0.7-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:a987f840718078212fdf4504d0fd4c6effe34a7e4740378e59d47696e8dfb477"}, + {file = "cryptography-42.0.7-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:bd13b5e9b543532453de08bcdc3cc7cebec6f9883e886fd20a92f26940fd3e7a"}, + {file = "cryptography-42.0.7-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a79165431551042cc9d1d90e6145d5d0d3ab0f2d66326c201d9b0e7f5bf43604"}, + {file = "cryptography-42.0.7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a47787a5e3649008a1102d3df55424e86606c9bae6fb77ac59afe06d234605f8"}, + {file = "cryptography-42.0.7-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:02c0eee2d7133bdbbc5e24441258d5d2244beb31da5ed19fbb80315f4bbbff55"}, + {file = "cryptography-42.0.7-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:5e44507bf8d14b36b8389b226665d597bc0f18ea035d75b4e53c7b1ea84583cc"}, + {file = "cryptography-42.0.7-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:7f8b25fa616d8b846aef64b15c606bb0828dbc35faf90566eb139aa9cff67af2"}, + {file = "cryptography-42.0.7-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:93a3209f6bb2b33e725ed08ee0991b92976dfdcf4e8b38646540674fc7508e13"}, + {file = "cryptography-42.0.7-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e6b8f1881dac458c34778d0a424ae5769de30544fc678eac51c1c8bb2183e9da"}, + {file = "cryptography-42.0.7-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3de9a45d3b2b7d8088c3fbf1ed4395dfeff79d07842217b38df14ef09ce1d8d7"}, + {file = "cryptography-42.0.7-cp37-abi3-win32.whl", hash = "sha256:789caea816c6704f63f6241a519bfa347f72fbd67ba28d04636b7c6b7da94b0b"}, + {file = "cryptography-42.0.7-cp37-abi3-win_amd64.whl", hash = "sha256:8cb8ce7c3347fcf9446f201dc30e2d5a3c898d009126010cbd1f443f28b52678"}, + {file = "cryptography-42.0.7-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:a3a5ac8b56fe37f3125e5b72b61dcde43283e5370827f5233893d461b7360cd4"}, + {file = "cryptography-42.0.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:779245e13b9a6638df14641d029add5dc17edbef6ec915688f3acb9e720a5858"}, + {file = "cryptography-42.0.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d563795db98b4cd57742a78a288cdbdc9daedac29f2239793071fe114f13785"}, + {file = "cryptography-42.0.7-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:31adb7d06fe4383226c3e963471f6837742889b3c4caa55aac20ad951bc8ffda"}, + {file = "cryptography-42.0.7-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:efd0bf5205240182e0f13bcaea41be4fdf5c22c5129fc7ced4a0282ac86998c9"}, + {file = "cryptography-42.0.7-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:a9bc127cdc4ecf87a5ea22a2556cab6c7eda2923f84e4f3cc588e8470ce4e42e"}, + {file = "cryptography-42.0.7-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:3577d029bc3f4827dd5bf8bf7710cac13527b470bbf1820a3f394adb38ed7d5f"}, + {file = "cryptography-42.0.7-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2e47577f9b18723fa294b0ea9a17d5e53a227867a0a4904a1a076d1646d45ca1"}, + {file = "cryptography-42.0.7-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:1a58839984d9cb34c855197043eaae2c187d930ca6d644612843b4fe8513c886"}, + {file = "cryptography-42.0.7-cp39-abi3-win32.whl", hash = "sha256:e6b79d0adb01aae87e8a44c2b64bc3f3fe59515280e00fb6d57a7267a2583cda"}, + {file = "cryptography-42.0.7-cp39-abi3-win_amd64.whl", hash = "sha256:16268d46086bb8ad5bf0a2b5544d8a9ed87a0e33f5e77dd3c3301e63d941a83b"}, + {file = "cryptography-42.0.7-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2954fccea107026512b15afb4aa664a5640cd0af630e2ee3962f2602693f0c82"}, + {file = "cryptography-42.0.7-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:362e7197754c231797ec45ee081f3088a27a47c6c01eff2ac83f60f85a50fe60"}, + {file = "cryptography-42.0.7-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4f698edacf9c9e0371112792558d2f705b5645076cc0aaae02f816a0171770fd"}, + {file = "cryptography-42.0.7-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5482e789294854c28237bba77c4c83be698be740e31a3ae5e879ee5444166582"}, + {file = "cryptography-42.0.7-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e9b2a6309f14c0497f348d08a065d52f3020656f675819fc405fb63bbcd26562"}, + {file = "cryptography-42.0.7-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d8e3098721b84392ee45af2dd554c947c32cc52f862b6a3ae982dbb90f577f14"}, + {file = "cryptography-42.0.7-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c65f96dad14f8528a447414125e1fc8feb2ad5a272b8f68477abbcc1ea7d94b9"}, + {file = "cryptography-42.0.7-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:36017400817987670037fbb0324d71489b6ead6231c9604f8fc1f7d008087c68"}, + {file = "cryptography-42.0.7.tar.gz", hash = "sha256:ecbfbc00bf55888edda9868a4cf927205de8499e7fabe6c050322298382953f2"}, ] [package.dependencies] @@ -490,38 +527,39 @@ test-randomorder = ["pytest-randomly"] [[package]] name = "dill" -version = "0.3.6" -description = "serialize all of python" +version = "0.3.8" +description = "serialize all of Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "dill-0.3.6-py3-none-any.whl", hash = "sha256:a07ffd2351b8c678dfc4a856a3005f8067aea51d6ba6c700796a4d9e280f39f0"}, - {file = "dill-0.3.6.tar.gz", hash = "sha256:e5db55f3687856d8fbdab002ed78544e1c4559a130302693d839dfe8f93f2373"}, + {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, + {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, ] [package.extras] graph = ["objgraph (>=1.7.2)"] +profile = ["gprof2dot (>=2022.7.29)"] [[package]] name = "docutils" -version = "0.17.1" +version = "0.18.1" description = "Docutils -- Python Documentation Utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ - {file = "docutils-0.17.1-py2.py3-none-any.whl", hash = "sha256:cf316c8370a737a022b72b56874f6602acf974a37a9fba42ec2876387549fc61"}, - {file = "docutils-0.17.1.tar.gz", hash = "sha256:686577d2e4c32380bb50cbb22f575ed742d58168cee37e99117a854bcd88f125"}, + {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, + {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, ] [[package]] name = "exceptiongroup" -version = "1.0.1" +version = "1.2.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.0.1-py3-none-any.whl", hash = "sha256:4d6c0aa6dd825810941c792f53d7b8d71da26f5e5f84f20f9508e8f2d33b140a"}, - {file = "exceptiongroup-1.0.1.tar.gz", hash = "sha256:73866f7f842ede6cb1daa42c4af078e2035e5f7607f0e2c762cc51bb31bbe7b2"}, + {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, + {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, ] [package.extras] @@ -529,85 +567,88 @@ test = ["pytest (>=6)"] [[package]] name = "frozenlist" -version = "1.3.3" +version = "1.4.1" description = "A list-like structure which implements collections.abc.MutableSequence" optional = false -python-versions = ">=3.7" -files = [ - {file = "frozenlist-1.3.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ff8bf625fe85e119553b5383ba0fb6aa3d0ec2ae980295aaefa552374926b3f4"}, - {file = "frozenlist-1.3.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dfbac4c2dfcc082fcf8d942d1e49b6aa0766c19d3358bd86e2000bf0fa4a9cf0"}, - {file = "frozenlist-1.3.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b1c63e8d377d039ac769cd0926558bb7068a1f7abb0f003e3717ee003ad85530"}, - {file = "frozenlist-1.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7fdfc24dcfce5b48109867c13b4cb15e4660e7bd7661741a391f821f23dfdca7"}, - {file = "frozenlist-1.3.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2c926450857408e42f0bbc295e84395722ce74bae69a3b2aa2a65fe22cb14b99"}, - {file = "frozenlist-1.3.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1841e200fdafc3d51f974d9d377c079a0694a8f06de2e67b48150328d66d5483"}, - {file = "frozenlist-1.3.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f470c92737afa7d4c3aacc001e335062d582053d4dbe73cda126f2d7031068dd"}, - {file = "frozenlist-1.3.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:783263a4eaad7c49983fe4b2e7b53fa9770c136c270d2d4bbb6d2192bf4d9caf"}, - {file = "frozenlist-1.3.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:924620eef691990dfb56dc4709f280f40baee568c794b5c1885800c3ecc69816"}, - {file = "frozenlist-1.3.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ae4dc05c465a08a866b7a1baf360747078b362e6a6dbeb0c57f234db0ef88ae0"}, - {file = "frozenlist-1.3.3-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:bed331fe18f58d844d39ceb398b77d6ac0b010d571cba8267c2e7165806b00ce"}, - {file = "frozenlist-1.3.3-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:02c9ac843e3390826a265e331105efeab489ffaf4dd86384595ee8ce6d35ae7f"}, - {file = "frozenlist-1.3.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:9545a33965d0d377b0bc823dcabf26980e77f1b6a7caa368a365a9497fb09420"}, - {file = "frozenlist-1.3.3-cp310-cp310-win32.whl", hash = "sha256:d5cd3ab21acbdb414bb6c31958d7b06b85eeb40f66463c264a9b343a4e238642"}, - {file = "frozenlist-1.3.3-cp310-cp310-win_amd64.whl", hash = "sha256:b756072364347cb6aa5b60f9bc18e94b2f79632de3b0190253ad770c5df17db1"}, - {file = "frozenlist-1.3.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b4395e2f8d83fbe0c627b2b696acce67868793d7d9750e90e39592b3626691b7"}, - {file = "frozenlist-1.3.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:14143ae966a6229350021384870458e4777d1eae4c28d1a7aa47f24d030e6678"}, - {file = "frozenlist-1.3.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5d8860749e813a6f65bad8285a0520607c9500caa23fea6ee407e63debcdbef6"}, - {file = "frozenlist-1.3.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23d16d9f477bb55b6154654e0e74557040575d9d19fe78a161bd33d7d76808e8"}, - {file = "frozenlist-1.3.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eb82dbba47a8318e75f679690190c10a5e1f447fbf9df41cbc4c3afd726d88cb"}, - {file = "frozenlist-1.3.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9309869032abb23d196cb4e4db574232abe8b8be1339026f489eeb34a4acfd91"}, - {file = "frozenlist-1.3.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a97b4fe50b5890d36300820abd305694cb865ddb7885049587a5678215782a6b"}, - {file = "frozenlist-1.3.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c188512b43542b1e91cadc3c6c915a82a5eb95929134faf7fd109f14f9892ce4"}, - {file = "frozenlist-1.3.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:303e04d422e9b911a09ad499b0368dc551e8c3cd15293c99160c7f1f07b59a48"}, - {file = "frozenlist-1.3.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:0771aed7f596c7d73444c847a1c16288937ef988dc04fb9f7be4b2aa91db609d"}, - {file = "frozenlist-1.3.3-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:66080ec69883597e4d026f2f71a231a1ee9887835902dbe6b6467d5a89216cf6"}, - {file = "frozenlist-1.3.3-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:41fe21dc74ad3a779c3d73a2786bdf622ea81234bdd4faf90b8b03cad0c2c0b4"}, - {file = "frozenlist-1.3.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f20380df709d91525e4bee04746ba612a4df0972c1b8f8e1e8af997e678c7b81"}, - {file = "frozenlist-1.3.3-cp311-cp311-win32.whl", hash = "sha256:f30f1928162e189091cf4d9da2eac617bfe78ef907a761614ff577ef4edfb3c8"}, - {file = "frozenlist-1.3.3-cp311-cp311-win_amd64.whl", hash = "sha256:a6394d7dadd3cfe3f4b3b186e54d5d8504d44f2d58dcc89d693698e8b7132b32"}, - {file = "frozenlist-1.3.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8df3de3a9ab8325f94f646609a66cbeeede263910c5c0de0101079ad541af332"}, - {file = "frozenlist-1.3.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0693c609e9742c66ba4870bcee1ad5ff35462d5ffec18710b4ac89337ff16e27"}, - {file = "frozenlist-1.3.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cd4210baef299717db0a600d7a3cac81d46ef0e007f88c9335db79f8979c0d3d"}, - {file = "frozenlist-1.3.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:394c9c242113bfb4b9aa36e2b80a05ffa163a30691c7b5a29eba82e937895d5e"}, - {file = "frozenlist-1.3.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6327eb8e419f7d9c38f333cde41b9ae348bec26d840927332f17e887a8dcb70d"}, - {file = "frozenlist-1.3.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e24900aa13212e75e5b366cb9065e78bbf3893d4baab6052d1aca10d46d944c"}, - {file = "frozenlist-1.3.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:3843f84a6c465a36559161e6c59dce2f2ac10943040c2fd021cfb70d58c4ad56"}, - {file = "frozenlist-1.3.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:84610c1502b2461255b4c9b7d5e9c48052601a8957cd0aea6ec7a7a1e1fb9420"}, - {file = "frozenlist-1.3.3-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:c21b9aa40e08e4f63a2f92ff3748e6b6c84d717d033c7b3438dd3123ee18f70e"}, - {file = "frozenlist-1.3.3-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:efce6ae830831ab6a22b9b4091d411698145cb9b8fc869e1397ccf4b4b6455cb"}, - {file = "frozenlist-1.3.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:40de71985e9042ca00b7953c4f41eabc3dc514a2d1ff534027f091bc74416401"}, - {file = "frozenlist-1.3.3-cp37-cp37m-win32.whl", hash = "sha256:180c00c66bde6146a860cbb81b54ee0df350d2daf13ca85b275123bbf85de18a"}, - {file = "frozenlist-1.3.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9bbbcedd75acdfecf2159663b87f1bb5cfc80e7cd99f7ddd9d66eb98b14a8411"}, - {file = "frozenlist-1.3.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:034a5c08d36649591be1cbb10e09da9f531034acfe29275fc5454a3b101ce41a"}, - {file = "frozenlist-1.3.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ba64dc2b3b7b158c6660d49cdb1d872d1d0bf4e42043ad8d5006099479a194e5"}, - {file = "frozenlist-1.3.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:47df36a9fe24054b950bbc2db630d508cca3aa27ed0566c0baf661225e52c18e"}, - {file = "frozenlist-1.3.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:008a054b75d77c995ea26629ab3a0c0d7281341f2fa7e1e85fa6153ae29ae99c"}, - {file = "frozenlist-1.3.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:841ea19b43d438a80b4de62ac6ab21cfe6827bb8a9dc62b896acc88eaf9cecba"}, - {file = "frozenlist-1.3.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e235688f42b36be2b6b06fc37ac2126a73b75fb8d6bc66dd632aa35286238703"}, - {file = "frozenlist-1.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca713d4af15bae6e5d79b15c10c8522859a9a89d3b361a50b817c98c2fb402a2"}, - {file = "frozenlist-1.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ac5995f2b408017b0be26d4a1d7c61bce106ff3d9e3324374d66b5964325448"}, - {file = "frozenlist-1.3.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:a4ae8135b11652b08a8baf07631d3ebfe65a4c87909dbef5fa0cdde440444ee4"}, - {file = "frozenlist-1.3.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4ea42116ceb6bb16dbb7d526e242cb6747b08b7710d9782aa3d6732bd8d27649"}, - {file = "frozenlist-1.3.3-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:810860bb4bdce7557bc0febb84bbd88198b9dbc2022d8eebe5b3590b2ad6c842"}, - {file = "frozenlist-1.3.3-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:ee78feb9d293c323b59a6f2dd441b63339a30edf35abcb51187d2fc26e696d13"}, - {file = "frozenlist-1.3.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0af2e7c87d35b38732e810befb9d797a99279cbb85374d42ea61c1e9d23094b3"}, - {file = "frozenlist-1.3.3-cp38-cp38-win32.whl", hash = "sha256:899c5e1928eec13fd6f6d8dc51be23f0d09c5281e40d9cf4273d188d9feeaf9b"}, - {file = "frozenlist-1.3.3-cp38-cp38-win_amd64.whl", hash = "sha256:7f44e24fa70f6fbc74aeec3e971f60a14dde85da364aa87f15d1be94ae75aeef"}, - {file = "frozenlist-1.3.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2b07ae0c1edaa0a36339ec6cce700f51b14a3fc6545fdd32930d2c83917332cf"}, - {file = "frozenlist-1.3.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ebb86518203e12e96af765ee89034a1dbb0c3c65052d1b0c19bbbd6af8a145e1"}, - {file = "frozenlist-1.3.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5cf820485f1b4c91e0417ea0afd41ce5cf5965011b3c22c400f6d144296ccbc0"}, - {file = "frozenlist-1.3.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c11e43016b9024240212d2a65043b70ed8dfd3b52678a1271972702d990ac6d"}, - {file = "frozenlist-1.3.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8fa3c6e3305aa1146b59a09b32b2e04074945ffcfb2f0931836d103a2c38f936"}, - {file = "frozenlist-1.3.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:352bd4c8c72d508778cf05ab491f6ef36149f4d0cb3c56b1b4302852255d05d5"}, - {file = "frozenlist-1.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:65a5e4d3aa679610ac6e3569e865425b23b372277f89b5ef06cf2cdaf1ebf22b"}, - {file = "frozenlist-1.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1e2c1185858d7e10ff045c496bbf90ae752c28b365fef2c09cf0fa309291669"}, - {file = "frozenlist-1.3.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f163d2fd041c630fed01bc48d28c3ed4a3b003c00acd396900e11ee5316b56bb"}, - {file = "frozenlist-1.3.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:05cdb16d09a0832eedf770cb7bd1fe57d8cf4eaf5aced29c4e41e3f20b30a784"}, - {file = "frozenlist-1.3.3-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:8bae29d60768bfa8fb92244b74502b18fae55a80eac13c88eb0b496d4268fd2d"}, - {file = "frozenlist-1.3.3-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:eedab4c310c0299961ac285591acd53dc6723a1ebd90a57207c71f6e0c2153ab"}, - {file = "frozenlist-1.3.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3bbdf44855ed8f0fbcd102ef05ec3012d6a4fd7c7562403f76ce6a52aeffb2b1"}, - {file = "frozenlist-1.3.3-cp39-cp39-win32.whl", hash = "sha256:efa568b885bca461f7c7b9e032655c0c143d305bf01c30caf6db2854a4532b38"}, - {file = "frozenlist-1.3.3-cp39-cp39-win_amd64.whl", hash = "sha256:cfe33efc9cb900a4c46f91a5ceba26d6df370ffddd9ca386eb1d4f0ad97b9ea9"}, - {file = "frozenlist-1.3.3.tar.gz", hash = "sha256:58bcc55721e8a90b88332d6cd441261ebb22342e238296bb330968952fbb3a6a"}, +python-versions = ">=3.8" +files = [ + {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f9aa1878d1083b276b0196f2dfbe00c9b7e752475ed3b682025ff20c1c1f51ac"}, + {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:29acab3f66f0f24674b7dc4736477bcd4bc3ad4b896f5f45379a67bce8b96868"}, + {file = "frozenlist-1.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:74fb4bee6880b529a0c6560885fce4dc95936920f9f20f53d99a213f7bf66776"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:590344787a90ae57d62511dd7c736ed56b428f04cd8c161fcc5e7232c130c69a"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:068b63f23b17df8569b7fdca5517edef76171cf3897eb68beb01341131fbd2ad"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c849d495bf5154cd8da18a9eb15db127d4dba2968d88831aff6f0331ea9bd4c"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9750cc7fe1ae3b1611bb8cfc3f9ec11d532244235d75901fb6b8e42ce9229dfe"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9b2de4cf0cdd5bd2dee4c4f63a653c61d2408055ab77b151c1957f221cabf2a"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0633c8d5337cb5c77acbccc6357ac49a1770b8c487e5b3505c57b949b4b82e98"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:27657df69e8801be6c3638054e202a135c7f299267f1a55ed3a598934f6c0d75"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:f9a3ea26252bd92f570600098783d1371354d89d5f6b7dfd87359d669f2109b5"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:4f57dab5fe3407b6c0c1cc907ac98e8a189f9e418f3b6e54d65a718aaafe3950"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e02a0e11cf6597299b9f3bbd3f93d79217cb90cfd1411aec33848b13f5c656cc"}, + {file = "frozenlist-1.4.1-cp310-cp310-win32.whl", hash = "sha256:a828c57f00f729620a442881cc60e57cfcec6842ba38e1b19fd3e47ac0ff8dc1"}, + {file = "frozenlist-1.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:f56e2333dda1fe0f909e7cc59f021eba0d2307bc6f012a1ccf2beca6ba362439"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a0cb6f11204443f27a1628b0e460f37fb30f624be6051d490fa7d7e26d4af3d0"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b46c8ae3a8f1f41a0d2ef350c0b6e65822d80772fe46b653ab6b6274f61d4a49"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fde5bd59ab5357e3853313127f4d3565fc7dad314a74d7b5d43c22c6a5ed2ced"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:722e1124aec435320ae01ee3ac7bec11a5d47f25d0ed6328f2273d287bc3abb0"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2471c201b70d58a0f0c1f91261542a03d9a5e088ed3dc6c160d614c01649c106"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c757a9dd70d72b076d6f68efdbb9bc943665ae954dad2801b874c8c69e185068"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f146e0911cb2f1da549fc58fc7bcd2b836a44b79ef871980d605ec392ff6b0d2"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f9c515e7914626b2a2e1e311794b4c35720a0be87af52b79ff8e1429fc25f19"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c302220494f5c1ebeb0912ea782bcd5e2f8308037b3c7553fad0e48ebad6ad82"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:442acde1e068288a4ba7acfe05f5f343e19fac87bfc96d89eb886b0363e977ec"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:1b280e6507ea8a4fa0c0a7150b4e526a8d113989e28eaaef946cc77ffd7efc0a"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:fe1a06da377e3a1062ae5fe0926e12b84eceb8a50b350ddca72dc85015873f74"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:db9e724bebd621d9beca794f2a4ff1d26eed5965b004a97f1f1685a173b869c2"}, + {file = "frozenlist-1.4.1-cp311-cp311-win32.whl", hash = "sha256:e774d53b1a477a67838a904131c4b0eef6b3d8a651f8b138b04f748fccfefe17"}, + {file = "frozenlist-1.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:fb3c2db03683b5767dedb5769b8a40ebb47d6f7f45b1b3e3b4b51ec8ad9d9825"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:1979bc0aeb89b33b588c51c54ab0161791149f2461ea7c7c946d95d5f93b56ae"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:cc7b01b3754ea68a62bd77ce6020afaffb44a590c2289089289363472d13aedb"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c9c92be9fd329ac801cc420e08452b70e7aeab94ea4233a4804f0915c14eba9b"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c3894db91f5a489fc8fa6a9991820f368f0b3cbdb9cd8849547ccfab3392d86"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba60bb19387e13597fb059f32cd4d59445d7b18b69a745b8f8e5db0346f33480"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8aefbba5f69d42246543407ed2461db31006b0f76c4e32dfd6f42215a2c41d09"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:780d3a35680ced9ce682fbcf4cb9c2bad3136eeff760ab33707b71db84664e3a"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9acbb16f06fe7f52f441bb6f413ebae6c37baa6ef9edd49cdd567216da8600cd"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:23b701e65c7b36e4bf15546a89279bd4d8675faabc287d06bbcfac7d3c33e1e6"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:3e0153a805a98f5ada7e09826255ba99fb4f7524bb81bf6b47fb702666484ae1"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:dd9b1baec094d91bf36ec729445f7769d0d0cf6b64d04d86e45baf89e2b9059b"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:1a4471094e146b6790f61b98616ab8e44f72661879cc63fa1049d13ef711e71e"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5667ed53d68d91920defdf4035d1cdaa3c3121dc0b113255124bcfada1cfa1b8"}, + {file = "frozenlist-1.4.1-cp312-cp312-win32.whl", hash = "sha256:beee944ae828747fd7cb216a70f120767fc9f4f00bacae8543c14a6831673f89"}, + {file = "frozenlist-1.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:64536573d0a2cb6e625cf309984e2d873979709f2cf22839bf2d61790b448ad5"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:20b51fa3f588ff2fe658663db52a41a4f7aa6c04f6201449c6c7c476bd255c0d"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:410478a0c562d1a5bcc2f7ea448359fcb050ed48b3c6f6f4f18c313a9bdb1826"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c6321c9efe29975232da3bd0af0ad216800a47e93d763ce64f291917a381b8eb"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:48f6a4533887e189dae092f1cf981f2e3885175f7a0f33c91fb5b7b682b6bab6"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6eb73fa5426ea69ee0e012fb59cdc76a15b1283d6e32e4f8dc4482ec67d1194d"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbeb989b5cc29e8daf7f976b421c220f1b8c731cbf22b9130d8815418ea45887"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:32453c1de775c889eb4e22f1197fe3bdfe457d16476ea407472b9442e6295f7a"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:693945278a31f2086d9bf3df0fe8254bbeaef1fe71e1351c3bd730aa7d31c41b"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:1d0ce09d36d53bbbe566fe296965b23b961764c0bcf3ce2fa45f463745c04701"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:3a670dc61eb0d0eb7080890c13de3066790f9049b47b0de04007090807c776b0"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:dca69045298ce5c11fd539682cff879cc1e664c245d1c64da929813e54241d11"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:a06339f38e9ed3a64e4c4e43aec7f59084033647f908e4259d279a52d3757d09"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b7f2f9f912dca3934c1baec2e4585a674ef16fe00218d833856408c48d5beee7"}, + {file = "frozenlist-1.4.1-cp38-cp38-win32.whl", hash = "sha256:e7004be74cbb7d9f34553a5ce5fb08be14fb33bc86f332fb71cbe5216362a497"}, + {file = "frozenlist-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:5a7d70357e7cee13f470c7883a063aae5fe209a493c57d86eb7f5a6f910fae09"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bfa4a17e17ce9abf47a74ae02f32d014c5e9404b6d9ac7f729e01562bbee601e"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b7e3ed87d4138356775346e6845cccbe66cd9e207f3cd11d2f0b9fd13681359d"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c99169d4ff810155ca50b4da3b075cbde79752443117d89429595c2e8e37fed8"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edb678da49d9f72c9f6c609fbe41a5dfb9a9282f9e6a2253d5a91e0fc382d7c0"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6db4667b187a6742b33afbbaf05a7bc551ffcf1ced0000a571aedbb4aa42fc7b"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55fdc093b5a3cb41d420884cdaf37a1e74c3c37a31f46e66286d9145d2063bd0"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82e8211d69a4f4bc360ea22cd6555f8e61a1bd211d1d5d39d3d228b48c83a897"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89aa2c2eeb20957be2d950b85974b30a01a762f3308cd02bb15e1ad632e22dc7"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9d3e0c25a2350080e9319724dede4f31f43a6c9779be48021a7f4ebde8b2d742"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7268252af60904bf52c26173cbadc3a071cece75f873705419c8681f24d3edea"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:0c250a29735d4f15321007fb02865f0e6b6a41a6b88f1f523ca1596ab5f50bd5"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:96ec70beabbd3b10e8bfe52616a13561e58fe84c0101dd031dc78f250d5128b9"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:23b2d7679b73fe0e5a4560b672a39f98dfc6f60df63823b0a9970525325b95f6"}, + {file = "frozenlist-1.4.1-cp39-cp39-win32.whl", hash = "sha256:a7496bfe1da7fb1a4e1cc23bb67c58fab69311cc7d32b5a99c2007b4b2a0e932"}, + {file = "frozenlist-1.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:e6a20a581f9ce92d389a8c7d7c3dd47c81fd5d6e655c8dddf341e14aa48659d0"}, + {file = "frozenlist-1.4.1-py3-none-any.whl", hash = "sha256:04ced3e6a46b4cfffe20f9ae482818e34eba9b5fb0ce4056e4cc9b6e212d09b7"}, + {file = "frozenlist-1.4.1.tar.gz", hash = "sha256:c037a86e8513059a2613aaba4d817bb90b9d9b6b69aace3ce9c877e8c8ed402b"}, ] [[package]] @@ -634,33 +675,32 @@ files = [ [[package]] name = "importlib-metadata" -version = "5.0.0" +version = "7.1.0" description = "Read metadata from Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "importlib_metadata-5.0.0-py3-none-any.whl", hash = "sha256:ddb0e35065e8938f867ed4928d0ae5bf2a53b7773871bfe6bcc7e4fcdc7dea43"}, - {file = "importlib_metadata-5.0.0.tar.gz", hash = "sha256:da31db32b304314d044d3c12c79bd59e307889b287ad12ff387b3500835fc2ab"}, + {file = "importlib_metadata-7.1.0-py3-none-any.whl", hash = "sha256:30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570"}, + {file = "importlib_metadata-7.1.0.tar.gz", hash = "sha256:b78938b926ee8d5f020fc4772d487045805a55ddbad2ecf21c6d60938dc7fcd2"}, ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] perf = ["ipython"] -testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-perf (>=0.9.2)", "pytest-ruff (>=0.2.1)"] [[package]] name = "iniconfig" -version = "1.1.1" -description = "iniconfig: brain-dead simple config-ini parsing" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, - {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] [[package]] @@ -679,20 +719,17 @@ six = "*" [[package]] name = "isort" -version = "5.10.1" +version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false -python-versions = ">=3.6.1,<4.0" +python-versions = ">=3.8.0" files = [ - {file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"}, - {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, ] [package.extras] -colors = ["colorama (>=0.4.3,<0.5.0)"] -pipfile-deprecated-finder = ["pipreqs", "requirementslib"] -plugins = ["setuptools"] -requirements-deprecated-finder = ["pip-api", "pipreqs"] +colors = ["colorama (>=0.4.6)"] [[package]] name = "jinja2" @@ -713,79 +750,117 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "lazy-object-proxy" -version = "1.8.0" +version = "1.10.0" description = "A fast and thorough lazy object proxy." optional = false -python-versions = ">=3.7" -files = [ - {file = "lazy-object-proxy-1.8.0.tar.gz", hash = "sha256:c219a00245af0f6fa4e95901ed28044544f50152840c5b6a3e7b2568db34d156"}, - {file = "lazy_object_proxy-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4fd031589121ad46e293629b39604031d354043bb5cdf83da4e93c2d7f3389fe"}, - {file = "lazy_object_proxy-1.8.0-cp310-cp310-win32.whl", hash = "sha256:b70d6e7a332eb0217e7872a73926ad4fdc14f846e85ad6749ad111084e76df25"}, - {file = "lazy_object_proxy-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:eb329f8d8145379bf5dbe722182410fe8863d186e51bf034d2075eb8d85ee25b"}, - {file = "lazy_object_proxy-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4e2d9f764f1befd8bdc97673261b8bb888764dfdbd7a4d8f55e4fbcabb8c3fb7"}, - {file = "lazy_object_proxy-1.8.0-cp311-cp311-win32.whl", hash = "sha256:e20bfa6db17a39c706d24f82df8352488d2943a3b7ce7d4c22579cb89ca8896e"}, - {file = "lazy_object_proxy-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:14010b49a2f56ec4943b6cf925f597b534ee2fe1f0738c84b3bce0c1a11ff10d"}, - {file = "lazy_object_proxy-1.8.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6850e4aeca6d0df35bb06e05c8b934ff7c533734eb51d0ceb2d63696f1e6030c"}, - {file = "lazy_object_proxy-1.8.0-cp37-cp37m-win32.whl", hash = "sha256:5b51d6f3bfeb289dfd4e95de2ecd464cd51982fe6f00e2be1d0bf94864d58acd"}, - {file = "lazy_object_proxy-1.8.0-cp37-cp37m-win_amd64.whl", hash = "sha256:6f593f26c470a379cf7f5bc6db6b5f1722353e7bf937b8d0d0b3fba911998858"}, - {file = "lazy_object_proxy-1.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0c1c7c0433154bb7c54185714c6929acc0ba04ee1b167314a779b9025517eada"}, - {file = "lazy_object_proxy-1.8.0-cp38-cp38-win32.whl", hash = "sha256:d176f392dbbdaacccf15919c77f526edf11a34aece58b55ab58539807b85436f"}, - {file = "lazy_object_proxy-1.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:afcaa24e48bb23b3be31e329deb3f1858f1f1df86aea3d70cb5c8578bfe5261c"}, - {file = "lazy_object_proxy-1.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:71d9ae8a82203511a6f60ca5a1b9f8ad201cac0fc75038b2dc5fa519589c9288"}, - {file = "lazy_object_proxy-1.8.0-cp39-cp39-win32.whl", hash = "sha256:8f6ce2118a90efa7f62dd38c7dbfffd42f468b180287b748626293bf12ed468f"}, - {file = "lazy_object_proxy-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:eac3a9a5ef13b332c059772fd40b4b1c3d45a3a2b05e33a361dee48e54a4dad0"}, - {file = "lazy_object_proxy-1.8.0-pp37-pypy37_pp73-any.whl", hash = "sha256:ae032743794fba4d171b5b67310d69176287b5bf82a21f588282406a79498891"}, - {file = "lazy_object_proxy-1.8.0-pp38-pypy38_pp73-any.whl", hash = "sha256:7e1561626c49cb394268edd00501b289053a652ed762c58e1081224c8d881cec"}, - {file = "lazy_object_proxy-1.8.0-pp39-pypy39_pp73-any.whl", hash = "sha256:ce58b2b3734c73e68f0e30e4e725264d4d6be95818ec0a0be4bb6bf9a7e79aa8"}, +python-versions = ">=3.8" +files = [ + {file = "lazy-object-proxy-1.10.0.tar.gz", hash = "sha256:78247b6d45f43a52ef35c25b5581459e85117225408a4128a3daf8bf9648ac69"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:855e068b0358ab916454464a884779c7ffa312b8925c6f7401e952dcf3b89977"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab7004cf2e59f7c2e4345604a3e6ea0d92ac44e1c2375527d56492014e690c3"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc0d2fc424e54c70c4bc06787e4072c4f3b1aa2f897dfdc34ce1013cf3ceef05"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e2adb09778797da09d2b5ebdbceebf7dd32e2c96f79da9052b2e87b6ea495895"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b1f711e2c6dcd4edd372cf5dec5c5a30d23bba06ee012093267b3376c079ec83"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-win32.whl", hash = "sha256:76a095cfe6045c7d0ca77db9934e8f7b71b14645f0094ffcd842349ada5c5fb9"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:b4f87d4ed9064b2628da63830986c3d2dca7501e6018347798313fcf028e2fd4"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fec03caabbc6b59ea4a638bee5fce7117be8e99a4103d9d5ad77f15d6f81020c"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02c83f957782cbbe8136bee26416686a6ae998c7b6191711a04da776dc9e47d4"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:009e6bb1f1935a62889ddc8541514b6a9e1fcf302667dcb049a0be5c8f613e56"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:75fc59fc450050b1b3c203c35020bc41bd2695ed692a392924c6ce180c6f1dc9"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:782e2c9b2aab1708ffb07d4bf377d12901d7a1d99e5e410d648d892f8967ab1f"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-win32.whl", hash = "sha256:edb45bb8278574710e68a6b021599a10ce730d156e5b254941754a9cc0b17d03"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:e271058822765ad5e3bca7f05f2ace0de58a3f4e62045a8c90a0dfd2f8ad8cc6"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e98c8af98d5707dcdecc9ab0863c0ea6e88545d42ca7c3feffb6b4d1e370c7ba"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:952c81d415b9b80ea261d2372d2a4a2332a3890c2b83e0535f263ddfe43f0d43"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80b39d3a151309efc8cc48675918891b865bdf742a8616a337cb0090791a0de9"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:e221060b701e2aa2ea991542900dd13907a5c90fa80e199dbf5a03359019e7a3"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:92f09ff65ecff3108e56526f9e2481b8116c0b9e1425325e13245abfd79bdb1b"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-win32.whl", hash = "sha256:3ad54b9ddbe20ae9f7c1b29e52f123120772b06dbb18ec6be9101369d63a4074"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:127a789c75151db6af398b8972178afe6bda7d6f68730c057fbbc2e96b08d282"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9e4ed0518a14dd26092614412936920ad081a424bdcb54cc13349a8e2c6d106a"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5ad9e6ed739285919aa9661a5bbed0aaf410aa60231373c5579c6b4801bd883c"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2fc0a92c02fa1ca1e84fc60fa258458e5bf89d90a1ddaeb8ed9cc3147f417255"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:0aefc7591920bbd360d57ea03c995cebc204b424524a5bd78406f6e1b8b2a5d8"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5faf03a7d8942bb4476e3b62fd0f4cf94eaf4618e304a19865abf89a35c0bbee"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-win32.whl", hash = "sha256:e333e2324307a7b5d86adfa835bb500ee70bfcd1447384a822e96495796b0ca4"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-win_amd64.whl", hash = "sha256:cb73507defd385b7705c599a94474b1d5222a508e502553ef94114a143ec6696"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:366c32fe5355ef5fc8a232c5436f4cc66e9d3e8967c01fb2e6302fd6627e3d94"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2297f08f08a2bb0d32a4265e98a006643cd7233fb7983032bd61ac7a02956b3b"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18dd842b49456aaa9a7cf535b04ca4571a302ff72ed8740d06b5adcd41fe0757"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:217138197c170a2a74ca0e05bddcd5f1796c735c37d0eee33e43259b192aa424"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9a3a87cf1e133e5b1994144c12ca4aa3d9698517fe1e2ca82977781b16955658"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-win32.whl", hash = "sha256:30b339b2a743c5288405aa79a69e706a06e02958eab31859f7f3c04980853b70"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:a899b10e17743683b293a729d3a11f2f399e8a90c73b089e29f5d0fe3509f0dd"}, + {file = "lazy_object_proxy-1.10.0-pp310.pp311.pp312.pp38.pp39-none-any.whl", hash = "sha256:80fa48bd89c8f2f456fc0765c11c23bf5af827febacd2f523ca5bc1893fcc09d"}, ] [[package]] name = "markupsafe" -version = "2.1.1" +version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." optional = false python-versions = ">=3.7" files = [ - {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-win32.whl", hash = "sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6"}, - {file = "MarkupSafe-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-win32.whl", hash = "sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff"}, - {file = "MarkupSafe-2.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-win32.whl", hash = "sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1"}, - {file = "MarkupSafe-2.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-win32.whl", hash = "sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c"}, - {file = "MarkupSafe-2.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247"}, - {file = "MarkupSafe-2.1.1.tar.gz", hash = "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win32.whl", hash = "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl", hash = "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win32.whl", hash = "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win32.whl", hash = "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win32.whl", hash = "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5"}, + {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, ] [[package]] @@ -801,39 +876,40 @@ files = [ [[package]] name = "msal" -version = "1.24.1" -description = "The Microsoft Authentication Library (MSAL) for Python library" +version = "1.28.0" +description = "The Microsoft Authentication Library (MSAL) for Python library enables your app to access the Microsoft Cloud by supporting authentication of users with Microsoft Azure Active Directory accounts (AAD) and Microsoft Accounts (MSA) using industry standard OAuth2 and OpenID Connect." optional = false -python-versions = ">=2.7" +python-versions = ">=3.7" files = [ - {file = "msal-1.24.1-py2.py3-none-any.whl", hash = "sha256:ce4320688f95c301ee74a4d0e9dbcfe029a63663a8cc61756f40d0d0d36574ad"}, - {file = "msal-1.24.1.tar.gz", hash = "sha256:aa0972884b3c6fdec53d9a0bd15c12e5bd7b71ac1b66d746f54d128709f3f8f8"}, + {file = "msal-1.28.0-py3-none-any.whl", hash = "sha256:3064f80221a21cd535ad8c3fafbb3a3582cd9c7e9af0bb789ae14f726a0ca99b"}, + {file = "msal-1.28.0.tar.gz", hash = "sha256:80bbabe34567cb734efd2ec1869b2d98195c927455369d8077b3c542088c5c9d"}, ] [package.dependencies] -cryptography = ">=0.6,<44" +cryptography = ">=0.6,<45" PyJWT = {version = ">=1.0.0,<3", extras = ["crypto"]} requests = ">=2.0.0,<3" [package.extras] -broker = ["pymsalruntime (>=0.13.2,<0.14)"] +broker = ["pymsalruntime (>=0.13.2,<0.15)"] [[package]] name = "msal-extensions" -version = "1.0.0" +version = "1.1.0" description = "Microsoft Authentication Library extensions (MSAL EX) provides a persistence API that can save your data on disk, encrypted on Windows, macOS and Linux. Concurrent data access will be coordinated by a file lock mechanism." optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "msal-extensions-1.0.0.tar.gz", hash = "sha256:c676aba56b0cce3783de1b5c5ecfe828db998167875126ca4b47dc6436451354"}, - {file = "msal_extensions-1.0.0-py2.py3-none-any.whl", hash = "sha256:91e3db9620b822d0ed2b4d1850056a0f133cba04455e62f11612e40f5502f2ee"}, + {file = "msal-extensions-1.1.0.tar.gz", hash = "sha256:6ab357867062db7b253d0bd2df6d411c7891a0ee7308d54d1e4317c1d1c54252"}, + {file = "msal_extensions-1.1.0-py3-none-any.whl", hash = "sha256:01be9711b4c0b1a151450068eeb2c4f0997df3bba085ac299de3a66f585e382f"}, ] [package.dependencies] msal = ">=0.4.1,<2.0.0" +packaging = "*" portalocker = [ - {version = ">=1.0,<3", markers = "python_version >= \"3.5\" and platform_system != \"Windows\""}, - {version = ">=1.6,<3", markers = "python_version >= \"3.5\" and platform_system == \"Windows\""}, + {version = ">=1.0,<3", markers = "platform_system != \"Windows\""}, + {version = ">=1.6,<3", markers = "platform_system == \"Windows\""}, ] [[package]] @@ -859,81 +935,112 @@ async = ["aiodns", "aiohttp (>=3.0)"] [[package]] name = "multidict" -version = "6.0.2" +version = "6.0.5" description = "multidict implementation" optional = false python-versions = ">=3.7" files = [ - {file = "multidict-6.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b9e95a740109c6047602f4db4da9949e6c5945cefbad34a1299775ddc9a62e2"}, - {file = "multidict-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ac0e27844758d7177989ce406acc6a83c16ed4524ebc363c1f748cba184d89d3"}, - {file = "multidict-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:041b81a5f6b38244b34dc18c7b6aba91f9cdaf854d9a39e5ff0b58e2b5773b9c"}, - {file = "multidict-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5fdda29a3c7e76a064f2477c9aab1ba96fd94e02e386f1e665bca1807fc5386f"}, - {file = "multidict-6.0.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3368bf2398b0e0fcbf46d85795adc4c259299fec50c1416d0f77c0a843a3eed9"}, - {file = "multidict-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f4f052ee022928d34fe1f4d2bc743f32609fb79ed9c49a1710a5ad6b2198db20"}, - {file = "multidict-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:225383a6603c086e6cef0f2f05564acb4f4d5f019a4e3e983f572b8530f70c88"}, - {file = "multidict-6.0.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50bd442726e288e884f7be9071016c15a8742eb689a593a0cac49ea093eef0a7"}, - {file = "multidict-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:47e6a7e923e9cada7c139531feac59448f1f47727a79076c0b1ee80274cd8eee"}, - {file = "multidict-6.0.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:0556a1d4ea2d949efe5fd76a09b4a82e3a4a30700553a6725535098d8d9fb672"}, - {file = "multidict-6.0.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:626fe10ac87851f4cffecee161fc6f8f9853f0f6f1035b59337a51d29ff3b4f9"}, - {file = "multidict-6.0.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:8064b7c6f0af936a741ea1efd18690bacfbae4078c0c385d7c3f611d11f0cf87"}, - {file = "multidict-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2d36e929d7f6a16d4eb11b250719c39560dd70545356365b494249e2186bc389"}, - {file = "multidict-6.0.2-cp310-cp310-win32.whl", hash = "sha256:fcb91630817aa8b9bc4a74023e4198480587269c272c58b3279875ed7235c293"}, - {file = "multidict-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:8cbf0132f3de7cc6c6ce00147cc78e6439ea736cee6bca4f068bcf892b0fd658"}, - {file = "multidict-6.0.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:05f6949d6169878a03e607a21e3b862eaf8e356590e8bdae4227eedadacf6e51"}, - {file = "multidict-6.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2c2e459f7050aeb7c1b1276763364884595d47000c1cddb51764c0d8976e608"}, - {file = "multidict-6.0.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d0509e469d48940147e1235d994cd849a8f8195e0bca65f8f5439c56e17872a3"}, - {file = "multidict-6.0.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:514fe2b8d750d6cdb4712346a2c5084a80220821a3e91f3f71eec11cf8d28fd4"}, - {file = "multidict-6.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:19adcfc2a7197cdc3987044e3f415168fc5dc1f720c932eb1ef4f71a2067e08b"}, - {file = "multidict-6.0.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b9d153e7f1f9ba0b23ad1568b3b9e17301e23b042c23870f9ee0522dc5cc79e8"}, - {file = "multidict-6.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:aef9cc3d9c7d63d924adac329c33835e0243b5052a6dfcbf7732a921c6e918ba"}, - {file = "multidict-6.0.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4571f1beddff25f3e925eea34268422622963cd8dc395bb8778eb28418248e43"}, - {file = "multidict-6.0.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:d48b8ee1d4068561ce8033d2c344cf5232cb29ee1a0206a7b828c79cbc5982b8"}, - {file = "multidict-6.0.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:45183c96ddf61bf96d2684d9fbaf6f3564d86b34cb125761f9a0ef9e36c1d55b"}, - {file = "multidict-6.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:75bdf08716edde767b09e76829db8c1e5ca9d8bb0a8d4bd94ae1eafe3dac5e15"}, - {file = "multidict-6.0.2-cp37-cp37m-win32.whl", hash = "sha256:a45e1135cb07086833ce969555df39149680e5471c04dfd6a915abd2fc3f6dbc"}, - {file = "multidict-6.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:6f3cdef8a247d1eafa649085812f8a310e728bdf3900ff6c434eafb2d443b23a"}, - {file = "multidict-6.0.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:0327292e745a880459ef71be14e709aaea2f783f3537588fb4ed09b6c01bca60"}, - {file = "multidict-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e875b6086e325bab7e680e4316d667fc0e5e174bb5611eb16b3ea121c8951b86"}, - {file = "multidict-6.0.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:feea820722e69451743a3d56ad74948b68bf456984d63c1a92e8347b7b88452d"}, - {file = "multidict-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc57c68cb9139c7cd6fc39f211b02198e69fb90ce4bc4a094cf5fe0d20fd8b0"}, - {file = "multidict-6.0.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:497988d6b6ec6ed6f87030ec03280b696ca47dbf0648045e4e1d28b80346560d"}, - {file = "multidict-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:89171b2c769e03a953d5969b2f272efa931426355b6c0cb508022976a17fd376"}, - {file = "multidict-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:684133b1e1fe91eda8fa7447f137c9490a064c6b7f392aa857bba83a28cfb693"}, - {file = "multidict-6.0.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd9fc9c4849a07f3635ccffa895d57abce554b467d611a5009ba4f39b78a8849"}, - {file = "multidict-6.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e07c8e79d6e6fd37b42f3250dba122053fddb319e84b55dd3a8d6446e1a7ee49"}, - {file = "multidict-6.0.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4070613ea2227da2bfb2c35a6041e4371b0af6b0be57f424fe2318b42a748516"}, - {file = "multidict-6.0.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:47fbeedbf94bed6547d3aa632075d804867a352d86688c04e606971595460227"}, - {file = "multidict-6.0.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:5774d9218d77befa7b70d836004a768fb9aa4fdb53c97498f4d8d3f67bb9cfa9"}, - {file = "multidict-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2957489cba47c2539a8eb7ab32ff49101439ccf78eab724c828c1a54ff3ff98d"}, - {file = "multidict-6.0.2-cp38-cp38-win32.whl", hash = "sha256:e5b20e9599ba74391ca0cfbd7b328fcc20976823ba19bc573983a25b32e92b57"}, - {file = "multidict-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:8004dca28e15b86d1b1372515f32eb6f814bdf6f00952699bdeb541691091f96"}, - {file = "multidict-6.0.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2e4a0785b84fb59e43c18a015ffc575ba93f7d1dbd272b4cdad9f5134b8a006c"}, - {file = "multidict-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6701bf8a5d03a43375909ac91b6980aea74b0f5402fbe9428fc3f6edf5d9677e"}, - {file = "multidict-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a007b1638e148c3cfb6bf0bdc4f82776cef0ac487191d093cdc316905e504071"}, - {file = "multidict-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:07a017cfa00c9890011628eab2503bee5872f27144936a52eaab449be5eaf032"}, - {file = "multidict-6.0.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c207fff63adcdf5a485969131dc70e4b194327666b7e8a87a97fbc4fd80a53b2"}, - {file = "multidict-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:373ba9d1d061c76462d74e7de1c0c8e267e9791ee8cfefcf6b0b2495762c370c"}, - {file = "multidict-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfba7c6d5d7c9099ba21f84662b037a0ffd4a5e6b26ac07d19e423e6fdf965a9"}, - {file = "multidict-6.0.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19d9bad105dfb34eb539c97b132057a4e709919ec4dd883ece5838bcbf262b80"}, - {file = "multidict-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:de989b195c3d636ba000ee4281cd03bb1234635b124bf4cd89eeee9ca8fcb09d"}, - {file = "multidict-6.0.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7c40b7bbece294ae3a87c1bc2abff0ff9beef41d14188cda94ada7bcea99b0fb"}, - {file = "multidict-6.0.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:d16cce709ebfadc91278a1c005e3c17dd5f71f5098bfae1035149785ea6e9c68"}, - {file = "multidict-6.0.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:a2c34a93e1d2aa35fbf1485e5010337c72c6791407d03aa5f4eed920343dd360"}, - {file = "multidict-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:feba80698173761cddd814fa22e88b0661e98cb810f9f986c54aa34d281e4937"}, - {file = "multidict-6.0.2-cp39-cp39-win32.whl", hash = "sha256:23b616fdc3c74c9fe01d76ce0d1ce872d2d396d8fa8e4899398ad64fb5aa214a"}, - {file = "multidict-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:4bae31803d708f6f15fd98be6a6ac0b6958fcf68fda3c77a048a4f9073704aae"}, - {file = "multidict-6.0.2.tar.gz", hash = "sha256:5ff3bd75f38e4c43f1f470f2df7a4d430b821c4ce22be384e1459cb57d6bb013"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b644ae063c10e7f324ab1ab6b548bdf6f8b47f3ec234fef1093bc2735e5f9"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:896ebdcf62683551312c30e20614305f53125750803b614e9e6ce74a96232604"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:411bf8515f3be9813d06004cac41ccf7d1cd46dfe233705933dd163b60e37600"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d147090048129ce3c453f0292e7697d333db95e52616b3793922945804a433c"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:215ed703caf15f578dca76ee6f6b21b7603791ae090fbf1ef9d865571039ade5"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c6390cf87ff6234643428991b7359b5f59cc15155695deb4eda5c777d2b880f"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fd81c4ebdb4f214161be351eb5bcf385426bf023041da2fd9e60681f3cebae"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3cc2ad10255f903656017363cd59436f2111443a76f996584d1077e43ee51182"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6939c95381e003f54cd4c5516740faba40cf5ad3eeff460c3ad1d3e0ea2549bf"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:220dd781e3f7af2c2c1053da9fa96d9cf3072ca58f057f4c5adaaa1cab8fc442"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:766c8f7511df26d9f11cd3a8be623e59cca73d44643abab3f8c8c07620524e4a"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:fe5d7785250541f7f5019ab9cba2c71169dc7d74d0f45253f8313f436458a4ef"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c1c1496e73051918fcd4f58ff2e0f2f3066d1c76a0c6aeffd9b45d53243702cc"}, + {file = "multidict-6.0.5-cp310-cp310-win32.whl", hash = "sha256:7afcdd1fc07befad18ec4523a782cde4e93e0a2bf71239894b8d61ee578c1319"}, + {file = "multidict-6.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:99f60d34c048c5c2fabc766108c103612344c46e35d4ed9ae0673d33c8fb26e8"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f285e862d2f153a70586579c15c44656f888806ed0e5b56b64489afe4a2dbfba"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:53689bb4e102200a4fafa9de9c7c3c212ab40a7ab2c8e474491914d2305f187e"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:612d1156111ae11d14afaf3a0669ebf6c170dbb735e510a7438ffe2369a847fd"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7be7047bd08accdb7487737631d25735c9a04327911de89ff1b26b81745bd4e3"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de170c7b4fe6859beb8926e84f7d7d6c693dfe8e27372ce3b76f01c46e489fcf"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04bde7a7b3de05732a4eb39c94574db1ec99abb56162d6c520ad26f83267de29"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:85f67aed7bb647f93e7520633d8f51d3cbc6ab96957c71272b286b2f30dc70ed"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425bf820055005bfc8aa9a0b99ccb52cc2f4070153e34b701acc98d201693733"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d3eb1ceec286eba8220c26f3b0096cf189aea7057b6e7b7a2e60ed36b373b77f"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:7901c05ead4b3fb75113fb1dd33eb1253c6d3ee37ce93305acd9d38e0b5f21a4"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:e0e79d91e71b9867c73323a3444724d496c037e578a0e1755ae159ba14f4f3d1"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:29bfeb0dff5cb5fdab2023a7a9947b3b4af63e9c47cae2a10ad58394b517fddc"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e030047e85cbcedbfc073f71836d62dd5dadfbe7531cae27789ff66bc551bd5e"}, + {file = "multidict-6.0.5-cp311-cp311-win32.whl", hash = "sha256:2f4848aa3baa109e6ab81fe2006c77ed4d3cd1e0ac2c1fbddb7b1277c168788c"}, + {file = "multidict-6.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:2faa5ae9376faba05f630d7e5e6be05be22913782b927b19d12b8145968a85ea"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:51d035609b86722963404f711db441cf7134f1889107fb171a970c9701f92e1e"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:cbebcd5bcaf1eaf302617c114aa67569dd3f090dd0ce8ba9e35e9985b41ac35b"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2ffc42c922dbfddb4a4c3b438eb056828719f07608af27d163191cb3e3aa6cc5"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ceb3b7e6a0135e092de86110c5a74e46bda4bd4fbfeeb3a3bcec79c0f861e450"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:79660376075cfd4b2c80f295528aa6beb2058fd289f4c9252f986751a4cd0496"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e4428b29611e989719874670fd152b6625500ad6c686d464e99f5aaeeaca175a"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d84a5c3a5f7ce6db1f999fb9438f686bc2e09d38143f2d93d8406ed2dd6b9226"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:76c0de87358b192de7ea9649beb392f107dcad9ad27276324c24c91774ca5271"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:79a6d2ba910adb2cbafc95dad936f8b9386e77c84c35bc0add315b856d7c3abb"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:92d16a3e275e38293623ebf639c471d3e03bb20b8ebb845237e0d3664914caef"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:fb616be3538599e797a2017cccca78e354c767165e8858ab5116813146041a24"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:14c2976aa9038c2629efa2c148022ed5eb4cb939e15ec7aace7ca932f48f9ba6"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:435a0984199d81ca178b9ae2c26ec3d49692d20ee29bc4c11a2a8d4514c67eda"}, + {file = "multidict-6.0.5-cp312-cp312-win32.whl", hash = "sha256:9fe7b0653ba3d9d65cbe7698cca585bf0f8c83dbbcc710db9c90f478e175f2d5"}, + {file = "multidict-6.0.5-cp312-cp312-win_amd64.whl", hash = "sha256:01265f5e40f5a17f8241d52656ed27192be03bfa8764d88e8220141d1e4b3556"}, + {file = "multidict-6.0.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:19fe01cea168585ba0f678cad6f58133db2aa14eccaf22f88e4a6dccadfad8b3"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6bf7a982604375a8d49b6cc1b781c1747f243d91b81035a9b43a2126c04766f5"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:107c0cdefe028703fb5dafe640a409cb146d44a6ae201e55b35a4af8e95457dd"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:403c0911cd5d5791605808b942c88a8155c2592e05332d2bf78f18697a5fa15e"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aeaf541ddbad8311a87dd695ed9642401131ea39ad7bc8cf3ef3967fd093b626"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e4972624066095e52b569e02b5ca97dbd7a7ddd4294bf4e7247d52635630dd83"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d946b0a9eb8aaa590df1fe082cee553ceab173e6cb5b03239716338629c50c7a"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b55358304d7a73d7bdf5de62494aaf70bd33015831ffd98bc498b433dfe5b10c"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:a3145cb08d8625b2d3fee1b2d596a8766352979c9bffe5d7833e0503d0f0b5e5"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:d65f25da8e248202bd47445cec78e0025c0fe7582b23ec69c3b27a640dd7a8e3"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c9bf56195c6bbd293340ea82eafd0071cb3d450c703d2c93afb89f93b8386ccc"}, + {file = "multidict-6.0.5-cp37-cp37m-win32.whl", hash = "sha256:69db76c09796b313331bb7048229e3bee7928eb62bab5e071e9f7fcc4879caee"}, + {file = "multidict-6.0.5-cp37-cp37m-win_amd64.whl", hash = "sha256:fce28b3c8a81b6b36dfac9feb1de115bab619b3c13905b419ec71d03a3fc1423"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:76f067f5121dcecf0d63a67f29080b26c43c71a98b10c701b0677e4a065fbd54"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b82cc8ace10ab5bd93235dfaab2021c70637005e1ac787031f4d1da63d493c1d"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5cb241881eefd96b46f89b1a056187ea8e9ba14ab88ba632e68d7a2ecb7aadf7"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8e94e6912639a02ce173341ff62cc1201232ab86b8a8fcc05572741a5dc7d93"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09a892e4a9fb47331da06948690ae38eaa2426de97b4ccbfafbdcbe5c8f37ff8"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55205d03e8a598cfc688c71ca8ea5f66447164efff8869517f175ea632c7cb7b"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37b15024f864916b4951adb95d3a80c9431299080341ab9544ed148091b53f50"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2a1dee728b52b33eebff5072817176c172050d44d67befd681609b4746e1c2e"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:edd08e6f2f1a390bf137080507e44ccc086353c8e98c657e666c017718561b89"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:60d698e8179a42ec85172d12f50b1668254628425a6bd611aba022257cac1386"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3d25f19500588cbc47dc19081d78131c32637c25804df8414463ec908631e453"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:4cc0ef8b962ac7a5e62b9e826bd0cd5040e7d401bc45a6835910ed699037a461"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:eca2e9d0cc5a889850e9bbd68e98314ada174ff6ccd1129500103df7a94a7a44"}, + {file = "multidict-6.0.5-cp38-cp38-win32.whl", hash = "sha256:4a6a4f196f08c58c59e0b8ef8ec441d12aee4125a7d4f4fef000ccb22f8d7241"}, + {file = "multidict-6.0.5-cp38-cp38-win_amd64.whl", hash = "sha256:0275e35209c27a3f7951e1ce7aaf93ce0d163b28948444bec61dd7badc6d3f8c"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e7be68734bd8c9a513f2b0cfd508802d6609da068f40dc57d4e3494cefc92929"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1d9ea7a7e779d7a3561aade7d596649fbecfa5c08a7674b11b423783217933f9"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ea1456df2a27c73ce51120fa2f519f1bea2f4a03a917f4a43c8707cf4cbbae1a"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf590b134eb70629e350691ecca88eac3e3b8b3c86992042fb82e3cb1830d5e1"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5c0631926c4f58e9a5ccce555ad7747d9a9f8b10619621f22f9635f069f6233e"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dce1c6912ab9ff5f179eaf6efe7365c1f425ed690b03341911bf4939ef2f3046"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0868d64af83169e4d4152ec612637a543f7a336e4a307b119e98042e852ad9c"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:141b43360bfd3bdd75f15ed811850763555a251e38b2405967f8e25fb43f7d40"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7df704ca8cf4a073334e0427ae2345323613e4df18cc224f647f251e5e75a527"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6214c5a5571802c33f80e6c84713b2c79e024995b9c5897f794b43e714daeec9"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:cd6c8fca38178e12c00418de737aef1261576bd1b6e8c6134d3e729a4e858b38"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e02021f87a5b6932fa6ce916ca004c4d441509d33bbdbeca70d05dff5e9d2479"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ebd8d160f91a764652d3e51ce0d2956b38efe37c9231cd82cfc0bed2e40b581c"}, + {file = "multidict-6.0.5-cp39-cp39-win32.whl", hash = "sha256:04da1bb8c8dbadf2a18a452639771951c662c5ad03aefe4884775454be322c9b"}, + {file = "multidict-6.0.5-cp39-cp39-win_amd64.whl", hash = "sha256:d6f6d4f185481c9669b9447bf9d9cf3b95a0e9df9d169bbc17e363b7d5487755"}, + {file = "multidict-6.0.5-py3-none-any.whl", hash = "sha256:0d63c74e3d7ab26de115c49bffc92cc77ed23395303d496eae515d4204a625e7"}, + {file = "multidict-6.0.5.tar.gz", hash = "sha256:f7e301075edaf50500f0b341543c41194d8df3ae5caf4702f2095f3ca73dd8da"}, ] [[package]] name = "mypy-extensions" -version = "0.4.3" -description = "Experimental type system extensions for programs checked with the mypy typechecker." +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." optional = false -python-versions = "*" +python-versions = ">=3.5" files = [ - {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, - {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, ] [[package]] @@ -954,71 +1061,66 @@ signedtoken = ["cryptography (>=3.0.0)", "pyjwt (>=2.0.0,<3)"] [[package]] name = "packaging" -version = "21.3" +version = "24.0" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, - {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, + {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, + {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, ] -[package.dependencies] -pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" - [[package]] name = "pathspec" -version = "0.10.1" +version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pathspec-0.10.1-py3-none-any.whl", hash = "sha256:46846318467efc4556ccfd27816e004270a9eeeeb4d062ce5e6fc7a87c573f93"}, - {file = "pathspec-0.10.1.tar.gz", hash = "sha256:7ace6161b621d31e7902eb6b5ae148d12cfd23f4a249b9ffb6b9fee12084323d"}, + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] [[package]] name = "platformdirs" -version = "2.5.3" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +version = "4.2.2" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "platformdirs-2.5.3-py3-none-any.whl", hash = "sha256:0cb405749187a194f444c25c82ef7225232f11564721eabffc6ec70df83b11cb"}, - {file = "platformdirs-2.5.3.tar.gz", hash = "sha256:6e52c21afff35cb659c6e52d8b4d61b9bd544557180440538f255d9382c8cbe0"}, + {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, + {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, ] [package.extras] -docs = ["furo (>=2022.9.29)", "proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.4)"] -test = ["appdirs (==1.4.4)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] +type = ["mypy (>=1.8)"] [[package]] name = "pluggy" -version = "1.0.0" +version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, - {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] [[package]] name = "portalocker" -version = "2.6.0" +version = "2.8.2" description = "Wraps the portalocker recipe for easy usage" optional = false -python-versions = ">=3.5" +python-versions = ">=3.8" files = [ - {file = "portalocker-2.6.0-py2.py3-none-any.whl", hash = "sha256:102ed1f2badd8dec9af3d732ef70e94b215b85ba45a8d7ff3c0003f19b442f4e"}, - {file = "portalocker-2.6.0.tar.gz", hash = "sha256:964f6830fb42a74b5d32bce99ed37d8308c1d7d44ddf18f3dd89f4680de97b39"}, + {file = "portalocker-2.8.2-py3-none-any.whl", hash = "sha256:cfb86acc09b9aa7c3b43594e19be1345b9d16af3feb08bf92f23d4dce513a28e"}, + {file = "portalocker-2.8.2.tar.gz", hash = "sha256:2b035aa7828e46c58e9b31390ee1f169b98e1066ab10b9a6a861fe7e25ee4f33"}, ] [package.dependencies] @@ -1027,42 +1129,42 @@ pywin32 = {version = ">=226", markers = "platform_system == \"Windows\""} [package.extras] docs = ["sphinx (>=1.7.1)"] redis = ["redis"] -tests = ["pytest (>=5.4.1)", "pytest-cov (>=2.8.1)", "pytest-mypy (>=0.8.0)", "pytest-timeout (>=2.1.0)", "redis", "sphinx (>=3.0.3)"] +tests = ["pytest (>=5.4.1)", "pytest-cov (>=2.8.1)", "pytest-mypy (>=0.8.0)", "pytest-timeout (>=2.1.0)", "redis", "sphinx (>=6.0.0)", "types-redis"] [[package]] name = "pycparser" -version = "2.21" +version = "2.22" description = "C parser in Python" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.8" files = [ - {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, - {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, + {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, + {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, ] [[package]] name = "pygments" -version = "2.15.0" +version = "2.18.0" description = "Pygments is a syntax highlighting package written in Python." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "Pygments-2.15.0-py3-none-any.whl", hash = "sha256:77a3299119af881904cd5ecd1ac6a66214b6e9bed1f2db16993b54adede64094"}, - {file = "Pygments-2.15.0.tar.gz", hash = "sha256:f7e36cffc4c517fbc252861b9a6e4644ca0e5abadf9a113c72d1358ad09b9500"}, + {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, + {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, ] [package.extras] -plugins = ["importlib-metadata"] +windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pyjwt" -version = "2.6.0" +version = "2.8.0" description = "JSON Web Token implementation in Python" optional = false python-versions = ">=3.7" files = [ - {file = "PyJWT-2.6.0-py3-none-any.whl", hash = "sha256:d83c3d892a77bbb74d3e1a2cfa90afaadb60945205d1095d9221f04466f64c14"}, - {file = "PyJWT-2.6.0.tar.gz", hash = "sha256:69285c7e31fc44f68a1feb309e948e0df53259d579295e6cfe2b1792329f05fd"}, + {file = "PyJWT-2.8.0-py3-none-any.whl", hash = "sha256:59127c392cc44c2da5bb3192169a91f429924e17aff6534d70fdc02ab3e04320"}, + {file = "PyJWT-2.8.0.tar.gz", hash = "sha256:57e28d156e3d5c10088e0c68abb90bfac3df82b40a71bd0daa20c65ccd5c23de"}, ] [package.dependencies] @@ -1076,19 +1178,22 @@ tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] [[package]] name = "pylint" -version = "2.15.5" +version = "2.17.7" description = "python code static checker" optional = false python-versions = ">=3.7.2" files = [ - {file = "pylint-2.15.5-py3-none-any.whl", hash = "sha256:c2108037eb074334d9e874dc3c783752cc03d0796c88c9a9af282d0f161a1004"}, - {file = "pylint-2.15.5.tar.gz", hash = "sha256:3b120505e5af1d06a5ad76b55d8660d44bf0f2fc3c59c2bdd94e39188ee3a4df"}, + {file = "pylint-2.17.7-py3-none-any.whl", hash = "sha256:27a8d4c7ddc8c2f8c18aa0050148f89ffc09838142193fdbe98f172781a3ff87"}, + {file = "pylint-2.17.7.tar.gz", hash = "sha256:f4fcac7ae74cfe36bc8451e931d8438e4a476c20314b1101c458ad0f05191fad"}, ] [package.dependencies] -astroid = ">=2.12.12,<=2.14.0-dev0" +astroid = ">=2.15.8,<=2.17.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -dill = ">=0.2" +dill = [ + {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\""}, +] isort = ">=4.2.5,<6" mccabe = ">=0.6,<0.8" platformdirs = ">=2.2.0" @@ -1100,43 +1205,27 @@ typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\"" spelling = ["pyenchant (>=3.2,<4.0)"] testutils = ["gitpython (>3)"] -[[package]] -name = "pyparsing" -version = "3.0.9" -description = "pyparsing module - Classes and methods to define and execute parsing grammars" -optional = false -python-versions = ">=3.6.8" -files = [ - {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, - {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, -] - -[package.extras] -diagrams = ["jinja2", "railroad-diagrams"] - [[package]] name = "pytest" -version = "7.2.0" +version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.2.0-py3-none-any.whl", hash = "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71"}, - {file = "pytest-7.2.0.tar.gz", hash = "sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59"}, + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, ] [package.dependencies] -attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "pytest-asyncio" @@ -1151,54 +1240,53 @@ files = [ [package.dependencies] pytest = ">=6.1.0" -typing-extensions = {version = ">=3.7.2", markers = "python_version < \"3.8\""} [package.extras] testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] [[package]] name = "pytz" -version = "2022.6" +version = "2024.1" description = "World timezone definitions, modern and historical" optional = false python-versions = "*" files = [ - {file = "pytz-2022.6-py2.py3-none-any.whl", hash = "sha256:222439474e9c98fced559f1709d89e6c9cbf8d79c794ff3eb9f8800064291427"}, - {file = "pytz-2022.6.tar.gz", hash = "sha256:e89512406b793ca39f5971bc999cc538ce125c0e51c27941bef4568b460095e2"}, + {file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"}, + {file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"}, ] [[package]] name = "pywin32" -version = "305" +version = "306" description = "Python for Window Extensions" optional = false python-versions = "*" files = [ - {file = "pywin32-305-cp310-cp310-win32.whl", hash = "sha256:421f6cd86e84bbb696d54563c48014b12a23ef95a14e0bdba526be756d89f116"}, - {file = "pywin32-305-cp310-cp310-win_amd64.whl", hash = "sha256:73e819c6bed89f44ff1d690498c0a811948f73777e5f97c494c152b850fad478"}, - {file = "pywin32-305-cp310-cp310-win_arm64.whl", hash = "sha256:742eb905ce2187133a29365b428e6c3b9001d79accdc30aa8969afba1d8470f4"}, - {file = "pywin32-305-cp311-cp311-win32.whl", hash = "sha256:19ca459cd2e66c0e2cc9a09d589f71d827f26d47fe4a9d09175f6aa0256b51c2"}, - {file = "pywin32-305-cp311-cp311-win_amd64.whl", hash = "sha256:326f42ab4cfff56e77e3e595aeaf6c216712bbdd91e464d167c6434b28d65990"}, - {file = "pywin32-305-cp311-cp311-win_arm64.whl", hash = "sha256:4ecd404b2c6eceaca52f8b2e3e91b2187850a1ad3f8b746d0796a98b4cea04db"}, - {file = "pywin32-305-cp36-cp36m-win32.whl", hash = "sha256:48d8b1659284f3c17b68587af047d110d8c44837736b8932c034091683e05863"}, - {file = "pywin32-305-cp36-cp36m-win_amd64.whl", hash = "sha256:13362cc5aa93c2beaf489c9c9017c793722aeb56d3e5166dadd5ef82da021fe1"}, - {file = "pywin32-305-cp37-cp37m-win32.whl", hash = "sha256:a55db448124d1c1484df22fa8bbcbc45c64da5e6eae74ab095b9ea62e6d00496"}, - {file = "pywin32-305-cp37-cp37m-win_amd64.whl", hash = "sha256:109f98980bfb27e78f4df8a51a8198e10b0f347257d1e265bb1a32993d0c973d"}, - {file = "pywin32-305-cp38-cp38-win32.whl", hash = "sha256:9dd98384da775afa009bc04863426cb30596fd78c6f8e4e2e5bbf4edf8029504"}, - {file = "pywin32-305-cp38-cp38-win_amd64.whl", hash = "sha256:56d7a9c6e1a6835f521788f53b5af7912090674bb84ef5611663ee1595860fc7"}, - {file = "pywin32-305-cp39-cp39-win32.whl", hash = "sha256:9d968c677ac4d5cbdaa62fd3014ab241718e619d8e36ef8e11fb930515a1e918"}, - {file = "pywin32-305-cp39-cp39-win_amd64.whl", hash = "sha256:50768c6b7c3f0b38b7fb14dd4104da93ebced5f1a50dc0e834594bff6fbe1271"}, + {file = "pywin32-306-cp310-cp310-win32.whl", hash = "sha256:06d3420a5155ba65f0b72f2699b5bacf3109f36acbe8923765c22938a69dfc8d"}, + {file = "pywin32-306-cp310-cp310-win_amd64.whl", hash = "sha256:84f4471dbca1887ea3803d8848a1616429ac94a4a8d05f4bc9c5dcfd42ca99c8"}, + {file = "pywin32-306-cp311-cp311-win32.whl", hash = "sha256:e65028133d15b64d2ed8f06dd9fbc268352478d4f9289e69c190ecd6818b6407"}, + {file = "pywin32-306-cp311-cp311-win_amd64.whl", hash = "sha256:a7639f51c184c0272e93f244eb24dafca9b1855707d94c192d4a0b4c01e1100e"}, + {file = "pywin32-306-cp311-cp311-win_arm64.whl", hash = "sha256:70dba0c913d19f942a2db25217d9a1b726c278f483a919f1abfed79c9cf64d3a"}, + {file = "pywin32-306-cp312-cp312-win32.whl", hash = "sha256:383229d515657f4e3ed1343da8be101000562bf514591ff383ae940cad65458b"}, + {file = "pywin32-306-cp312-cp312-win_amd64.whl", hash = "sha256:37257794c1ad39ee9be652da0462dc2e394c8159dfd913a8a4e8eb6fd346da0e"}, + {file = "pywin32-306-cp312-cp312-win_arm64.whl", hash = "sha256:5821ec52f6d321aa59e2db7e0a35b997de60c201943557d108af9d4ae1ec7040"}, + {file = "pywin32-306-cp37-cp37m-win32.whl", hash = "sha256:1c73ea9a0d2283d889001998059f5eaaba3b6238f767c9cf2833b13e6a685f65"}, + {file = "pywin32-306-cp37-cp37m-win_amd64.whl", hash = "sha256:72c5f621542d7bdd4fdb716227be0dd3f8565c11b280be6315b06ace35487d36"}, + {file = "pywin32-306-cp38-cp38-win32.whl", hash = "sha256:e4c092e2589b5cf0d365849e73e02c391c1349958c5ac3e9d5ccb9a28e017b3a"}, + {file = "pywin32-306-cp38-cp38-win_amd64.whl", hash = "sha256:e8ac1ae3601bee6ca9f7cb4b5363bf1c0badb935ef243c4733ff9a393b1690c0"}, + {file = "pywin32-306-cp39-cp39-win32.whl", hash = "sha256:e25fd5b485b55ac9c057f67d94bc203f3f6595078d1fb3b458c9c28b7153a802"}, + {file = "pywin32-306-cp39-cp39-win_amd64.whl", hash = "sha256:39b61c15272833b5c329a2989999dcae836b1eed650252ab1b7bfbe1d59f30f4"}, ] [[package]] name = "requests" -version = "2.31.0" +version = "2.32.2" description = "Python HTTP for Humans." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, - {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, + {file = "requests-2.32.2-py3-none-any.whl", hash = "sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c"}, + {file = "requests-2.32.2.tar.gz", hash = "sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289"}, ] [package.dependencies] @@ -1213,13 +1301,13 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "requests-oauthlib" -version = "1.3.1" +version = "2.0.0" description = "OAuthlib authentication support for Requests." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.4" files = [ - {file = "requests-oauthlib-1.3.1.tar.gz", hash = "sha256:75beac4a47881eeb94d5ea5d6ad31ef88856affe2332b9aafb52c6452ccf0d7a"}, - {file = "requests_oauthlib-1.3.1-py2.py3-none-any.whl", hash = "sha256:2577c501a2fb8d05a304c09d090d6e47c306fef15809d102b327cf8364bddab5"}, + {file = "requests-oauthlib-2.0.0.tar.gz", hash = "sha256:b3dffaebd884d8cd778494369603a9e7b58d29111bf6b41bdc2dcd87203af4e9"}, + {file = "requests_oauthlib-2.0.0-py2.py3-none-any.whl", hash = "sha256:7dd8a5c40426b779b0868c404bdef9768deccf22749cde15852df527e6269b36"}, ] [package.dependencies] @@ -1242,7 +1330,6 @@ files = [ [package.dependencies] requests = ">=2.0,<3.0" -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} urllib3 = ">=1.25.10" [package.extras] @@ -1307,31 +1394,32 @@ test = ["cython", "html5lib", "pytest (>=4.6)", "typed_ast"] [[package]] name = "sphinx-rtd-theme" -version = "1.1.1" +version = "1.3.0" description = "Read the Docs theme for Sphinx" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ - {file = "sphinx_rtd_theme-1.1.1-py2.py3-none-any.whl", hash = "sha256:31faa07d3e97c8955637fc3f1423a5ab2c44b74b8cc558a51498c202ce5cbda7"}, - {file = "sphinx_rtd_theme-1.1.1.tar.gz", hash = "sha256:6146c845f1e1947b3c3dd4432c28998a1693ccc742b4f9ad7c63129f0757c103"}, + {file = "sphinx_rtd_theme-1.3.0-py2.py3-none-any.whl", hash = "sha256:46ddef89cc2416a81ecfbeaceab1881948c014b1b6e4450b815311a89fb977b0"}, + {file = "sphinx_rtd_theme-1.3.0.tar.gz", hash = "sha256:590b030c7abb9cf038ec053b95e5380b5c70d61591eb0b552063fbe7c41f0931"}, ] [package.dependencies] -docutils = "<0.18" -sphinx = ">=1.6,<6" +docutils = "<0.19" +sphinx = ">=1.6,<8" +sphinxcontrib-jquery = ">=4,<5" [package.extras] dev = ["bump2version", "sphinxcontrib-httpdomain", "transifex-client", "wheel"] [[package]] name = "sphinxcontrib-applehelp" -version = "1.0.2" -description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" +version = "1.0.4" +description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" optional = false -python-versions = ">=3.5" +python-versions = ">=3.8" files = [ - {file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"}, - {file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"}, + {file = "sphinxcontrib-applehelp-1.0.4.tar.gz", hash = "sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e"}, + {file = "sphinxcontrib_applehelp-1.0.4-py3-none-any.whl", hash = "sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228"}, ] [package.extras] @@ -1355,19 +1443,33 @@ test = ["pytest"] [[package]] name = "sphinxcontrib-htmlhelp" -version = "2.0.0" +version = "2.0.1" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "sphinxcontrib-htmlhelp-2.0.0.tar.gz", hash = "sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2"}, - {file = "sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl", hash = "sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07"}, + {file = "sphinxcontrib-htmlhelp-2.0.1.tar.gz", hash = "sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff"}, + {file = "sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl", hash = "sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903"}, ] [package.extras] lint = ["docutils-stubs", "flake8", "mypy"] test = ["html5lib", "pytest"] +[[package]] +name = "sphinxcontrib-jquery" +version = "4.1" +description = "Extension to include jQuery on newer Sphinx releases" +optional = false +python-versions = ">=2.7" +files = [ + {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, + {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, +] + +[package.dependencies] +Sphinx = ">=1.8" + [[package]] name = "sphinxcontrib-jsmath" version = "1.0.1" @@ -1425,250 +1527,244 @@ files = [ [[package]] name = "tomlkit" -version = "0.11.6" +version = "0.12.5" description = "Style preserving TOML library" optional = false -python-versions = ">=3.6" -files = [ - {file = "tomlkit-0.11.6-py3-none-any.whl", hash = "sha256:07de26b0d8cfc18f871aec595fda24d95b08fef89d147caa861939f37230bf4b"}, - {file = "tomlkit-0.11.6.tar.gz", hash = "sha256:71b952e5721688937fb02cf9d354dbcf0785066149d2855e44531ebdd2b65d73"}, -] - -[[package]] -name = "typed-ast" -version = "1.5.4" -description = "a fork of Python 2 and 3 ast modules with type comment support" -optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "typed_ast-1.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:669dd0c4167f6f2cd9f57041e03c3c2ebf9063d0757dc89f79ba1daa2bfca9d4"}, - {file = "typed_ast-1.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:211260621ab1cd7324e0798d6be953d00b74e0428382991adfddb352252f1d62"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:267e3f78697a6c00c689c03db4876dd1efdfea2f251a5ad6555e82a26847b4ac"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c542eeda69212fa10a7ada75e668876fdec5f856cd3d06829e6aa64ad17c8dfe"}, - {file = "typed_ast-1.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:a9916d2bb8865f973824fb47436fa45e1ebf2efd920f2b9f99342cb7fab93f72"}, - {file = "typed_ast-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:79b1e0869db7c830ba6a981d58711c88b6677506e648496b1f64ac7d15633aec"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a94d55d142c9265f4ea46fab70977a1944ecae359ae867397757d836ea5a3f47"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:183afdf0ec5b1b211724dfef3d2cad2d767cbefac291f24d69b00546c1837fb6"}, - {file = "typed_ast-1.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:639c5f0b21776605dd6c9dbe592d5228f021404dafd377e2b7ac046b0349b1a1"}, - {file = "typed_ast-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cf4afcfac006ece570e32d6fa90ab74a17245b83dfd6655a6f68568098345ff6"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed855bbe3eb3715fca349c80174cfcfd699c2f9de574d40527b8429acae23a66"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6778e1b2f81dfc7bc58e4b259363b83d2e509a65198e85d5700dfae4c6c8ff1c"}, - {file = "typed_ast-1.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:0261195c2062caf107831e92a76764c81227dae162c4f75192c0d489faf751a2"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2efae9db7a8c05ad5547d522e7dbe62c83d838d3906a3716d1478b6c1d61388d"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7d5d014b7daa8b0bf2eaef684295acae12b036d79f54178b92a2b6a56f92278f"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:370788a63915e82fd6f212865a596a0fefcbb7d408bbbb13dea723d971ed8bdc"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4e964b4ff86550a7a7d56345c7864b18f403f5bd7380edf44a3c1fb4ee7ac6c6"}, - {file = "typed_ast-1.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:683407d92dc953c8a7347119596f0b0e6c55eb98ebebd9b23437501b28dcbb8e"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4879da6c9b73443f97e731b617184a596ac1235fe91f98d279a7af36c796da35"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3e123d878ba170397916557d31c8f589951e353cc95fb7f24f6bb69adc1a8a97"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebd9d7f80ccf7a82ac5f88c521115cc55d84e35bf8b446fcd7836eb6b98929a3"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98f80dee3c03455e92796b58b98ff6ca0b2a6f652120c263efdba4d6c5e58f72"}, - {file = "typed_ast-1.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:0fdbcf2fef0ca421a3f5912555804296f0b0960f0418c440f5d6d3abb549f3e1"}, - {file = "typed_ast-1.5.4.tar.gz", hash = "sha256:39e21ceb7388e4bb37f4c679d72707ed46c2fbf2a5609b8b8ebc4b067d977df2"}, + {file = "tomlkit-0.12.5-py3-none-any.whl", hash = "sha256:af914f5a9c59ed9d0762c7b64d3b5d5df007448eb9cd2edc8a46b1eafead172f"}, + {file = "tomlkit-0.12.5.tar.gz", hash = "sha256:eef34fba39834d4d6b73c9ba7f3e4d1c417a4e56f89a7e96e090dd0d24b8fb3c"}, ] [[package]] name = "typing-extensions" -version = "4.4.0" -description = "Backported and Experimental Type Hints for Python 3.7+" +version = "4.12.0" +description = "Backported and Experimental Type Hints for Python 3.8+" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.4.0-py3-none-any.whl", hash = "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e"}, - {file = "typing_extensions-4.4.0.tar.gz", hash = "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa"}, + {file = "typing_extensions-4.12.0-py3-none-any.whl", hash = "sha256:b349c66bea9016ac22978d800cfff206d5f9816951f12a7d0ec5578b0a819594"}, + {file = "typing_extensions-4.12.0.tar.gz", hash = "sha256:8cbcdc8606ebcb0d95453ad7dc5065e6237b6aa230a31e81d0f440c30fed5fd8"}, ] [[package]] name = "urllib3" -version = "1.26.18" +version = "2.2.1" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = ">=3.8" files = [ - {file = "urllib3-1.26.18-py2.py3-none-any.whl", hash = "sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07"}, - {file = "urllib3-1.26.18.tar.gz", hash = "sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0"}, + {file = "urllib3-2.2.1-py3-none-any.whl", hash = "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"}, + {file = "urllib3-2.2.1.tar.gz", hash = "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19"}, ] [package.extras] -brotli = ["brotli (==1.0.9)", "brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] -secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] [[package]] name = "wrapt" -version = "1.14.1" +version = "1.16.0" description = "Module for decorators, wrappers and monkey patching." optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -files = [ - {file = "wrapt-1.14.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:1b376b3f4896e7930f1f772ac4b064ac12598d1c38d04907e696cc4d794b43d3"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:903500616422a40a98a5a3c4ff4ed9d0066f3b4c951fa286018ecdf0750194ef"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5a9a0d155deafd9448baff28c08e150d9b24ff010e899311ddd63c45c2445e28"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:ddaea91abf8b0d13443f6dac52e89051a5063c7d014710dcb4d4abb2ff811a59"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:36f582d0c6bc99d5f39cd3ac2a9062e57f3cf606ade29a0a0d6b323462f4dd87"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:7ef58fb89674095bfc57c4069e95d7a31cfdc0939e2a579882ac7d55aadfd2a1"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:e2f83e18fe2f4c9e7db597e988f72712c0c3676d337d8b101f6758107c42425b"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:ee2b1b1769f6707a8a445162ea16dddf74285c3964f605877a20e38545c3c462"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:833b58d5d0b7e5b9832869f039203389ac7cbf01765639c7309fd50ef619e0b1"}, - {file = "wrapt-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:80bb5c256f1415f747011dc3604b59bc1f91c6e7150bd7db03b19170ee06b320"}, - {file = "wrapt-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:07f7a7d0f388028b2df1d916e94bbb40624c59b48ecc6cbc232546706fac74c2"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02b41b633c6261feff8ddd8d11c711df6842aba629fdd3da10249a53211a72c4"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2fe803deacd09a233e4762a1adcea5db5d31e6be577a43352936179d14d90069"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:257fd78c513e0fb5cdbe058c27a0624c9884e735bbd131935fd49e9fe719d310"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4fcc4649dc762cddacd193e6b55bc02edca674067f5f98166d7713b193932b7f"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:11871514607b15cfeb87c547a49bca19fde402f32e2b1c24a632506c0a756656"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8ad85f7f4e20964db4daadcab70b47ab05c7c1cf2a7c1e51087bfaa83831854c"}, - {file = "wrapt-1.14.1-cp310-cp310-win32.whl", hash = "sha256:a9a52172be0b5aae932bef82a79ec0a0ce87288c7d132946d645eba03f0ad8a8"}, - {file = "wrapt-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:6d323e1554b3d22cfc03cd3243b5bb815a51f5249fdcbb86fda4bf62bab9e164"}, - {file = "wrapt-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ecee4132c6cd2ce5308e21672015ddfed1ff975ad0ac8d27168ea82e71413f55"}, - {file = "wrapt-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2020f391008ef874c6d9e208b24f28e31bcb85ccff4f335f15a3251d222b92d9"}, - {file = "wrapt-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2feecf86e1f7a86517cab34ae6c2f081fd2d0dac860cb0c0ded96d799d20b335"}, - {file = "wrapt-1.14.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:240b1686f38ae665d1b15475966fe0472f78e71b1b4903c143a842659c8e4cb9"}, - {file = "wrapt-1.14.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9008dad07d71f68487c91e96579c8567c98ca4c3881b9b113bc7b33e9fd78b8"}, - {file = "wrapt-1.14.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6447e9f3ba72f8e2b985a1da758767698efa72723d5b59accefd716e9e8272bf"}, - {file = "wrapt-1.14.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:acae32e13a4153809db37405f5eba5bac5fbe2e2ba61ab227926a22901051c0a"}, - {file = "wrapt-1.14.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:49ef582b7a1152ae2766557f0550a9fcbf7bbd76f43fbdc94dd3bf07cc7168be"}, - {file = "wrapt-1.14.1-cp311-cp311-win32.whl", hash = "sha256:358fe87cc899c6bb0ddc185bf3dbfa4ba646f05b1b0b9b5a27c2cb92c2cea204"}, - {file = "wrapt-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:26046cd03936ae745a502abf44dac702a5e6880b2b01c29aea8ddf3353b68224"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:43ca3bbbe97af00f49efb06e352eae40434ca9d915906f77def219b88e85d907"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:6b1a564e6cb69922c7fe3a678b9f9a3c54e72b469875aa8018f18b4d1dd1adf3"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:00b6d4ea20a906c0ca56d84f93065b398ab74b927a7a3dbd470f6fc503f95dc3"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:a85d2b46be66a71bedde836d9e41859879cc54a2a04fad1191eb50c2066f6e9d"}, - {file = "wrapt-1.14.1-cp35-cp35m-win32.whl", hash = "sha256:dbcda74c67263139358f4d188ae5faae95c30929281bc6866d00573783c422b7"}, - {file = "wrapt-1.14.1-cp35-cp35m-win_amd64.whl", hash = "sha256:b21bb4c09ffabfa0e85e3a6b623e19b80e7acd709b9f91452b8297ace2a8ab00"}, - {file = "wrapt-1.14.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:9e0fd32e0148dd5dea6af5fee42beb949098564cc23211a88d799e434255a1f4"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9736af4641846491aedb3c3f56b9bc5568d92b0692303b5a305301a95dfd38b1"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5b02d65b9ccf0ef6c34cba6cf5bf2aab1bb2f49c6090bafeecc9cd81ad4ea1c1"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21ac0156c4b089b330b7666db40feee30a5d52634cc4560e1905d6529a3897ff"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:9f3e6f9e05148ff90002b884fbc2a86bd303ae847e472f44ecc06c2cd2fcdb2d"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:6e743de5e9c3d1b7185870f480587b75b1cb604832e380d64f9504a0535912d1"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:d79d7d5dc8a32b7093e81e97dad755127ff77bcc899e845f41bf71747af0c569"}, - {file = "wrapt-1.14.1-cp36-cp36m-win32.whl", hash = "sha256:81b19725065dcb43df02b37e03278c011a09e49757287dca60c5aecdd5a0b8ed"}, - {file = "wrapt-1.14.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b014c23646a467558be7da3d6b9fa409b2c567d2110599b7cf9a0c5992b3b471"}, - {file = "wrapt-1.14.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:88bd7b6bd70a5b6803c1abf6bca012f7ed963e58c68d76ee20b9d751c74a3248"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b5901a312f4d14c59918c221323068fad0540e34324925c8475263841dbdfe68"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d77c85fedff92cf788face9bfa3ebaa364448ebb1d765302e9af11bf449ca36d"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d649d616e5c6a678b26d15ece345354f7c2286acd6db868e65fcc5ff7c24a77"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7d2872609603cb35ca513d7404a94d6d608fc13211563571117046c9d2bcc3d7"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ee6acae74a2b91865910eef5e7de37dc6895ad96fa23603d1d27ea69df545015"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2b39d38039a1fdad98c87279b48bc5dce2c0ca0d73483b12cb72aa9609278e8a"}, - {file = "wrapt-1.14.1-cp37-cp37m-win32.whl", hash = "sha256:60db23fa423575eeb65ea430cee741acb7c26a1365d103f7b0f6ec412b893853"}, - {file = "wrapt-1.14.1-cp37-cp37m-win_amd64.whl", hash = "sha256:709fe01086a55cf79d20f741f39325018f4df051ef39fe921b1ebe780a66184c"}, - {file = "wrapt-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8c0ce1e99116d5ab21355d8ebe53d9460366704ea38ae4d9f6933188f327b456"}, - {file = "wrapt-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e3fb1677c720409d5f671e39bac6c9e0e422584e5f518bfd50aa4cbbea02433f"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:642c2e7a804fcf18c222e1060df25fc210b9c58db7c91416fb055897fc27e8cc"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b7c050ae976e286906dd3f26009e117eb000fb2cf3533398c5ad9ccc86867b1"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef3f72c9666bba2bab70d2a8b79f2c6d2c1a42a7f7e2b0ec83bb2f9e383950af"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:01c205616a89d09827986bc4e859bcabd64f5a0662a7fe95e0d359424e0e071b"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5a0f54ce2c092aaf439813735584b9537cad479575a09892b8352fea5e988dc0"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2cf71233a0ed05ccdabe209c606fe0bac7379fdcf687f39b944420d2a09fdb57"}, - {file = "wrapt-1.14.1-cp38-cp38-win32.whl", hash = "sha256:aa31fdcc33fef9eb2552cbcbfee7773d5a6792c137b359e82879c101e98584c5"}, - {file = "wrapt-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:d1967f46ea8f2db647c786e78d8cc7e4313dbd1b0aca360592d8027b8508e24d"}, - {file = "wrapt-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3232822c7d98d23895ccc443bbdf57c7412c5a65996c30442ebe6ed3df335383"}, - {file = "wrapt-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:988635d122aaf2bdcef9e795435662bcd65b02f4f4c1ae37fbee7401c440b3a7"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cca3c2cdadb362116235fdbd411735de4328c61425b0aa9f872fd76d02c4e86"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d52a25136894c63de15a35bc0bdc5adb4b0e173b9c0d07a2be9d3ca64a332735"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40e7bc81c9e2b2734ea4bc1aceb8a8f0ceaac7c5299bc5d69e37c44d9081d43b"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b9b7a708dd92306328117d8c4b62e2194d00c365f18eff11a9b53c6f923b01e3"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6a9a25751acb379b466ff6be78a315e2b439d4c94c1e99cb7266d40a537995d3"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:34aa51c45f28ba7f12accd624225e2b1e5a3a45206aa191f6f9aac931d9d56fe"}, - {file = "wrapt-1.14.1-cp39-cp39-win32.whl", hash = "sha256:dee0ce50c6a2dd9056c20db781e9c1cfd33e77d2d569f5d1d9321c641bb903d5"}, - {file = "wrapt-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:dee60e1de1898bde3b238f18340eec6148986da0455d8ba7848d50470a7a32fb"}, - {file = "wrapt-1.14.1.tar.gz", hash = "sha256:380a85cf89e0e69b7cfbe2ea9f765f004ff419f34194018a6827ac0e3edfed4d"}, +python-versions = ">=3.6" +files = [ + {file = "wrapt-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4"}, + {file = "wrapt-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020"}, + {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb2dee3874a500de01c93d5c71415fcaef1d858370d405824783e7a8ef5db440"}, + {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a88e6010048489cda82b1326889ec075a8c856c2e6a256072b28eaee3ccf487"}, + {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac83a914ebaf589b69f7d0a1277602ff494e21f4c2f743313414378f8f50a4cf"}, + {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:73aa7d98215d39b8455f103de64391cb79dfcad601701a3aa0dddacf74911d72"}, + {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:807cc8543a477ab7422f1120a217054f958a66ef7314f76dd9e77d3f02cdccd0"}, + {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bf5703fdeb350e36885f2875d853ce13172ae281c56e509f4e6eca049bdfb136"}, + {file = "wrapt-1.16.0-cp310-cp310-win32.whl", hash = "sha256:f6b2d0c6703c988d334f297aa5df18c45e97b0af3679bb75059e0e0bd8b1069d"}, + {file = "wrapt-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:decbfa2f618fa8ed81c95ee18a387ff973143c656ef800c9f24fb7e9c16054e2"}, + {file = "wrapt-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1a5db485fe2de4403f13fafdc231b0dbae5eca4359232d2efc79025527375b09"}, + {file = "wrapt-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:75ea7d0ee2a15733684badb16de6794894ed9c55aa5e9903260922f0482e687d"}, + {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a452f9ca3e3267cd4d0fcf2edd0d035b1934ac2bd7e0e57ac91ad6b95c0c6389"}, + {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43aa59eadec7890d9958748db829df269f0368521ba6dc68cc172d5d03ed8060"}, + {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72554a23c78a8e7aa02abbd699d129eead8b147a23c56e08d08dfc29cfdddca1"}, + {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d2efee35b4b0a347e0d99d28e884dfd82797852d62fcd7ebdeee26f3ceb72cf3"}, + {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6dcfcffe73710be01d90cae08c3e548d90932d37b39ef83969ae135d36ef3956"}, + {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:eb6e651000a19c96f452c85132811d25e9264d836951022d6e81df2fff38337d"}, + {file = "wrapt-1.16.0-cp311-cp311-win32.whl", hash = "sha256:66027d667efe95cc4fa945af59f92c5a02c6f5bb6012bff9e60542c74c75c362"}, + {file = "wrapt-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:aefbc4cb0a54f91af643660a0a150ce2c090d3652cf4052a5397fb2de549cd89"}, + {file = "wrapt-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5eb404d89131ec9b4f748fa5cfb5346802e5ee8836f57d516576e61f304f3b7b"}, + {file = "wrapt-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9090c9e676d5236a6948330e83cb89969f433b1943a558968f659ead07cb3b36"}, + {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94265b00870aa407bd0cbcfd536f17ecde43b94fb8d228560a1e9d3041462d73"}, + {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2058f813d4f2b5e3a9eb2eb3faf8f1d99b81c3e51aeda4b168406443e8ba809"}, + {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98b5e1f498a8ca1858a1cdbffb023bfd954da4e3fa2c0cb5853d40014557248b"}, + {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:14d7dc606219cdd7405133c713f2c218d4252f2a469003f8c46bb92d5d095d81"}, + {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:49aac49dc4782cb04f58986e81ea0b4768e4ff197b57324dcbd7699c5dfb40b9"}, + {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:418abb18146475c310d7a6dc71143d6f7adec5b004ac9ce08dc7a34e2babdc5c"}, + {file = "wrapt-1.16.0-cp312-cp312-win32.whl", hash = "sha256:685f568fa5e627e93f3b52fda002c7ed2fa1800b50ce51f6ed1d572d8ab3e7fc"}, + {file = "wrapt-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:dcdba5c86e368442528f7060039eda390cc4091bfd1dca41e8046af7c910dda8"}, + {file = "wrapt-1.16.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d462f28826f4657968ae51d2181a074dfe03c200d6131690b7d65d55b0f360f8"}, + {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a33a747400b94b6d6b8a165e4480264a64a78c8a4c734b62136062e9a248dd39"}, + {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3646eefa23daeba62643a58aac816945cadc0afaf21800a1421eeba5f6cfb9c"}, + {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ebf019be5c09d400cf7b024aa52b1f3aeebeff51550d007e92c3c1c4afc2a40"}, + {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0d2691979e93d06a95a26257adb7bfd0c93818e89b1406f5a28f36e0d8c1e1fc"}, + {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:1acd723ee2a8826f3d53910255643e33673e1d11db84ce5880675954183ec47e"}, + {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc57efac2da352a51cc4658878a68d2b1b67dbe9d33c36cb826ca449d80a8465"}, + {file = "wrapt-1.16.0-cp36-cp36m-win32.whl", hash = "sha256:da4813f751142436b075ed7aa012a8778aa43a99f7b36afe9b742d3ed8bdc95e"}, + {file = "wrapt-1.16.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6f6eac2360f2d543cc875a0e5efd413b6cbd483cb3ad7ebf888884a6e0d2e966"}, + {file = "wrapt-1.16.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a0ea261ce52b5952bf669684a251a66df239ec6d441ccb59ec7afa882265d593"}, + {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bd2d7ff69a2cac767fbf7a2b206add2e9a210e57947dd7ce03e25d03d2de292"}, + {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9159485323798c8dc530a224bd3ffcf76659319ccc7bbd52e01e73bd0241a0c5"}, + {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a86373cf37cd7764f2201b76496aba58a52e76dedfaa698ef9e9688bfd9e41cf"}, + {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:73870c364c11f03ed072dda68ff7aea6d2a3a5c3fe250d917a429c7432e15228"}, + {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b935ae30c6e7400022b50f8d359c03ed233d45b725cfdd299462f41ee5ffba6f"}, + {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:db98ad84a55eb09b3c32a96c576476777e87c520a34e2519d3e59c44710c002c"}, + {file = "wrapt-1.16.0-cp37-cp37m-win32.whl", hash = "sha256:9153ed35fc5e4fa3b2fe97bddaa7cbec0ed22412b85bcdaf54aeba92ea37428c"}, + {file = "wrapt-1.16.0-cp37-cp37m-win_amd64.whl", hash = "sha256:66dfbaa7cfa3eb707bbfcd46dab2bc6207b005cbc9caa2199bcbc81d95071a00"}, + {file = "wrapt-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1dd50a2696ff89f57bd8847647a1c363b687d3d796dc30d4dd4a9d1689a706f0"}, + {file = "wrapt-1.16.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:44a2754372e32ab315734c6c73b24351d06e77ffff6ae27d2ecf14cf3d229202"}, + {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e9723528b9f787dc59168369e42ae1c3b0d3fadb2f1a71de14531d321ee05b0"}, + {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbed418ba5c3dce92619656802cc5355cb679e58d0d89b50f116e4a9d5a9603e"}, + {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:941988b89b4fd6b41c3f0bfb20e92bd23746579736b7343283297c4c8cbae68f"}, + {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6a42cd0cfa8ffc1915aef79cb4284f6383d8a3e9dcca70c445dcfdd639d51267"}, + {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ca9b6085e4f866bd584fb135a041bfc32cab916e69f714a7d1d397f8c4891ca"}, + {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5e49454f19ef621089e204f862388d29e6e8d8b162efce05208913dde5b9ad6"}, + {file = "wrapt-1.16.0-cp38-cp38-win32.whl", hash = "sha256:c31f72b1b6624c9d863fc095da460802f43a7c6868c5dda140f51da24fd47d7b"}, + {file = "wrapt-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:490b0ee15c1a55be9c1bd8609b8cecd60e325f0575fc98f50058eae366e01f41"}, + {file = "wrapt-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9b201ae332c3637a42f02d1045e1d0cccfdc41f1f2f801dafbaa7e9b4797bfc2"}, + {file = "wrapt-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2076fad65c6736184e77d7d4729b63a6d1ae0b70da4868adeec40989858eb3fb"}, + {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5cd603b575ebceca7da5a3a251e69561bec509e0b46e4993e1cac402b7247b8"}, + {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47cfad9e9bbbed2339081f4e346c93ecd7ab504299403320bf85f7f85c7d46c"}, + {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8212564d49c50eb4565e502814f694e240c55551a5f1bc841d4fcaabb0a9b8a"}, + {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5f15814a33e42b04e3de432e573aa557f9f0f56458745c2074952f564c50e664"}, + {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db2e408d983b0e61e238cf579c09ef7020560441906ca990fe8412153e3b291f"}, + {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:edfad1d29c73f9b863ebe7082ae9321374ccb10879eeabc84ba3b69f2579d537"}, + {file = "wrapt-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed867c42c268f876097248e05b6117a65bcd1e63b779e916fe2e33cd6fd0d3c3"}, + {file = "wrapt-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:eb1b046be06b0fce7249f1d025cd359b4b80fc1c3e24ad9eca33e0dcdb2e4a35"}, + {file = "wrapt-1.16.0-py3-none-any.whl", hash = "sha256:6906c4100a8fcbf2fa735f6059214bb13b97f75b1a61777fcf6432121ef12ef1"}, + {file = "wrapt-1.16.0.tar.gz", hash = "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"}, ] [[package]] name = "yarl" -version = "1.8.1" +version = "1.9.4" description = "Yet another URL library" optional = false python-versions = ">=3.7" files = [ - {file = "yarl-1.8.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:abc06b97407868ef38f3d172762f4069323de52f2b70d133d096a48d72215d28"}, - {file = "yarl-1.8.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:07b21e274de4c637f3e3b7104694e53260b5fc10d51fb3ec5fed1da8e0f754e3"}, - {file = "yarl-1.8.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9de955d98e02fab288c7718662afb33aab64212ecb368c5dc866d9a57bf48880"}, - {file = "yarl-1.8.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ec362167e2c9fd178f82f252b6d97669d7245695dc057ee182118042026da40"}, - {file = "yarl-1.8.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:20df6ff4089bc86e4a66e3b1380460f864df3dd9dccaf88d6b3385d24405893b"}, - {file = "yarl-1.8.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5999c4662631cb798496535afbd837a102859568adc67d75d2045e31ec3ac497"}, - {file = "yarl-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed19b74e81b10b592084a5ad1e70f845f0aacb57577018d31de064e71ffa267a"}, - {file = "yarl-1.8.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e4808f996ca39a6463f45182e2af2fae55e2560be586d447ce8016f389f626f"}, - {file = "yarl-1.8.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:2d800b9c2eaf0684c08be5f50e52bfa2aa920e7163c2ea43f4f431e829b4f0fd"}, - {file = "yarl-1.8.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6628d750041550c5d9da50bb40b5cf28a2e63b9388bac10fedd4f19236ef4957"}, - {file = "yarl-1.8.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:f5af52738e225fcc526ae64071b7e5342abe03f42e0e8918227b38c9aa711e28"}, - {file = "yarl-1.8.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:76577f13333b4fe345c3704811ac7509b31499132ff0181f25ee26619de2c843"}, - {file = "yarl-1.8.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0c03f456522d1ec815893d85fccb5def01ffaa74c1b16ff30f8aaa03eb21e453"}, - {file = "yarl-1.8.1-cp310-cp310-win32.whl", hash = "sha256:ea30a42dc94d42f2ba4d0f7c0ffb4f4f9baa1b23045910c0c32df9c9902cb272"}, - {file = "yarl-1.8.1-cp310-cp310-win_amd64.whl", hash = "sha256:9130ddf1ae9978abe63808b6b60a897e41fccb834408cde79522feb37fb72fb0"}, - {file = "yarl-1.8.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0ab5a138211c1c366404d912824bdcf5545ccba5b3ff52c42c4af4cbdc2c5035"}, - {file = "yarl-1.8.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0fb2cb4204ddb456a8e32381f9a90000429489a25f64e817e6ff94879d432fc"}, - {file = "yarl-1.8.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:85cba594433915d5c9a0d14b24cfba0339f57a2fff203a5d4fd070e593307d0b"}, - {file = "yarl-1.8.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1ca7e596c55bd675432b11320b4eacc62310c2145d6801a1f8e9ad160685a231"}, - {file = "yarl-1.8.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0f77539733e0ec2475ddcd4e26777d08996f8cd55d2aef82ec4d3896687abda"}, - {file = "yarl-1.8.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:29e256649f42771829974e742061c3501cc50cf16e63f91ed8d1bf98242e5507"}, - {file = "yarl-1.8.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7fce6cbc6c170ede0221cc8c91b285f7f3c8b9fe28283b51885ff621bbe0f8ee"}, - {file = "yarl-1.8.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:59ddd85a1214862ce7c7c66457f05543b6a275b70a65de366030d56159a979f0"}, - {file = "yarl-1.8.1-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:12768232751689c1a89b0376a96a32bc7633c08da45ad985d0c49ede691f5c0d"}, - {file = "yarl-1.8.1-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:b19255dde4b4f4c32e012038f2c169bb72e7f081552bea4641cab4d88bc409dd"}, - {file = "yarl-1.8.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:6c8148e0b52bf9535c40c48faebb00cb294ee577ca069d21bd5c48d302a83780"}, - {file = "yarl-1.8.1-cp37-cp37m-win32.whl", hash = "sha256:de839c3a1826a909fdbfe05f6fe2167c4ab033f1133757b5936efe2f84904c07"}, - {file = "yarl-1.8.1-cp37-cp37m-win_amd64.whl", hash = "sha256:dd032e8422a52e5a4860e062eb84ac94ea08861d334a4bcaf142a63ce8ad4802"}, - {file = "yarl-1.8.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:19cd801d6f983918a3f3a39f3a45b553c015c5aac92ccd1fac619bd74beece4a"}, - {file = "yarl-1.8.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6347f1a58e658b97b0a0d1ff7658a03cb79bdbda0331603bed24dd7054a6dea1"}, - {file = "yarl-1.8.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7c0da7e44d0c9108d8b98469338705e07f4bb7dab96dbd8fa4e91b337db42548"}, - {file = "yarl-1.8.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5587bba41399854703212b87071c6d8638fa6e61656385875f8c6dff92b2e461"}, - {file = "yarl-1.8.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:31a9a04ecccd6b03e2b0e12e82131f1488dea5555a13a4d32f064e22a6003cfe"}, - {file = "yarl-1.8.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:205904cffd69ae972a1707a1bd3ea7cded594b1d773a0ce66714edf17833cdae"}, - {file = "yarl-1.8.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea513a25976d21733bff523e0ca836ef1679630ef4ad22d46987d04b372d57fc"}, - {file = "yarl-1.8.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d0b51530877d3ad7a8d47b2fff0c8df3b8f3b8deddf057379ba50b13df2a5eae"}, - {file = "yarl-1.8.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d2b8f245dad9e331540c350285910b20dd913dc86d4ee410c11d48523c4fd546"}, - {file = "yarl-1.8.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ab2a60d57ca88e1d4ca34a10e9fb4ab2ac5ad315543351de3a612bbb0560bead"}, - {file = "yarl-1.8.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:449c957ffc6bc2309e1fbe67ab7d2c1efca89d3f4912baeb8ead207bb3cc1cd4"}, - {file = "yarl-1.8.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:a165442348c211b5dea67c0206fc61366212d7082ba8118c8c5c1c853ea4d82e"}, - {file = "yarl-1.8.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b3ded839a5c5608eec8b6f9ae9a62cb22cd037ea97c627f38ae0841a48f09eae"}, - {file = "yarl-1.8.1-cp38-cp38-win32.whl", hash = "sha256:c1445a0c562ed561d06d8cbc5c8916c6008a31c60bc3655cdd2de1d3bf5174a0"}, - {file = "yarl-1.8.1-cp38-cp38-win_amd64.whl", hash = "sha256:56c11efb0a89700987d05597b08a1efcd78d74c52febe530126785e1b1a285f4"}, - {file = "yarl-1.8.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e80ed5a9939ceb6fda42811542f31c8602be336b1fb977bccb012e83da7e4936"}, - {file = "yarl-1.8.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6afb336e23a793cd3b6476c30f030a0d4c7539cd81649683b5e0c1b0ab0bf350"}, - {file = "yarl-1.8.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4c322cbaa4ed78a8aac89b2174a6df398faf50e5fc12c4c191c40c59d5e28357"}, - {file = "yarl-1.8.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fae37373155f5ef9b403ab48af5136ae9851151f7aacd9926251ab26b953118b"}, - {file = "yarl-1.8.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5395da939ffa959974577eff2cbfc24b004a2fb6c346918f39966a5786874e54"}, - {file = "yarl-1.8.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:076eede537ab978b605f41db79a56cad2e7efeea2aa6e0fa8f05a26c24a034fb"}, - {file = "yarl-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d1a50e461615747dd93c099f297c1994d472b0f4d2db8a64e55b1edf704ec1c"}, - {file = "yarl-1.8.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7de89c8456525650ffa2bb56a3eee6af891e98f498babd43ae307bd42dca98f6"}, - {file = "yarl-1.8.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4a88510731cd8d4befaba5fbd734a7dd914de5ab8132a5b3dde0bbd6c9476c64"}, - {file = "yarl-1.8.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2d93a049d29df172f48bcb09acf9226318e712ce67374f893b460b42cc1380ae"}, - {file = "yarl-1.8.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:21ac44b763e0eec15746a3d440f5e09ad2ecc8b5f6dcd3ea8cb4773d6d4703e3"}, - {file = "yarl-1.8.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:d0272228fabe78ce00a3365ffffd6f643f57a91043e119c289aaba202f4095b0"}, - {file = "yarl-1.8.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:99449cd5366fe4608e7226c6cae80873296dfa0cde45d9b498fefa1de315a09e"}, - {file = "yarl-1.8.1-cp39-cp39-win32.whl", hash = "sha256:8b0af1cf36b93cee99a31a545fe91d08223e64390c5ecc5e94c39511832a4bb6"}, - {file = "yarl-1.8.1-cp39-cp39-win_amd64.whl", hash = "sha256:de49d77e968de6626ba7ef4472323f9d2e5a56c1d85b7c0e2a190b2173d3b9be"}, - {file = "yarl-1.8.1.tar.gz", hash = "sha256:af887845b8c2e060eb5605ff72b6f2dd2aab7a761379373fd89d314f4752abbf"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a8c1df72eb746f4136fe9a2e72b0c9dc1da1cbd23b5372f94b5820ff8ae30e0e"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a3a6ed1d525bfb91b3fc9b690c5a21bb52de28c018530ad85093cc488bee2dd2"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c38c9ddb6103ceae4e4498f9c08fac9b590c5c71b0370f98714768e22ac6fa66"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d9e09c9d74f4566e905a0b8fa668c58109f7624db96a2171f21747abc7524234"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8477c1ee4bd47c57d49621a062121c3023609f7a13b8a46953eb6c9716ca392"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5ff2c858f5f6a42c2a8e751100f237c5e869cbde669a724f2062d4c4ef93551"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:357495293086c5b6d34ca9616a43d329317feab7917518bc97a08f9e55648455"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54525ae423d7b7a8ee81ba189f131054defdb122cde31ff17477951464c1691c"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:801e9264d19643548651b9db361ce3287176671fb0117f96b5ac0ee1c3530d53"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e516dc8baf7b380e6c1c26792610230f37147bb754d6426462ab115a02944385"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:7d5aaac37d19b2904bb9dfe12cdb08c8443e7ba7d2852894ad448d4b8f442863"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:54beabb809ffcacbd9d28ac57b0db46e42a6e341a030293fb3185c409e626b8b"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bac8d525a8dbc2a1507ec731d2867025d11ceadcb4dd421423a5d42c56818541"}, + {file = "yarl-1.9.4-cp310-cp310-win32.whl", hash = "sha256:7855426dfbddac81896b6e533ebefc0af2f132d4a47340cee6d22cac7190022d"}, + {file = "yarl-1.9.4-cp310-cp310-win_amd64.whl", hash = "sha256:848cd2a1df56ddbffeb375535fb62c9d1645dde33ca4d51341378b3f5954429b"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:35a2b9396879ce32754bd457d31a51ff0a9d426fd9e0e3c33394bf4b9036b099"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c7d56b293cc071e82532f70adcbd8b61909eec973ae9d2d1f9b233f3d943f2c"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d8a1c6c0be645c745a081c192e747c5de06e944a0d21245f4cf7c05e457c36e0"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b3c1ffe10069f655ea2d731808e76e0f452fc6c749bea04781daf18e6039525"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:549d19c84c55d11687ddbd47eeb348a89df9cb30e1993f1b128f4685cd0ebbf8"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7409f968456111140c1c95301cadf071bd30a81cbd7ab829169fb9e3d72eae9"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e23a6d84d9d1738dbc6e38167776107e63307dfc8ad108e580548d1f2c587f42"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8b889777de69897406c9fb0b76cdf2fd0f31267861ae7501d93003d55f54fbe"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:03caa9507d3d3c83bca08650678e25364e1843b484f19986a527630ca376ecce"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4e9035df8d0880b2f1c7f5031f33f69e071dfe72ee9310cfc76f7b605958ceb9"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:c0ec0ed476f77db9fb29bca17f0a8fcc7bc97ad4c6c1d8959c507decb22e8572"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:ee04010f26d5102399bd17f8df8bc38dc7ccd7701dc77f4a68c5b8d733406958"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:49a180c2e0743d5d6e0b4d1a9e5f633c62eca3f8a86ba5dd3c471060e352ca98"}, + {file = "yarl-1.9.4-cp311-cp311-win32.whl", hash = "sha256:81eb57278deb6098a5b62e88ad8281b2ba09f2f1147c4767522353eaa6260b31"}, + {file = "yarl-1.9.4-cp311-cp311-win_amd64.whl", hash = "sha256:d1d2532b340b692880261c15aee4dc94dd22ca5d61b9db9a8a361953d36410b1"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0d2454f0aef65ea81037759be5ca9947539667eecebca092733b2eb43c965a81"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:44d8ffbb9c06e5a7f529f38f53eda23e50d1ed33c6c869e01481d3fafa6b8142"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:aaaea1e536f98754a6e5c56091baa1b6ce2f2700cc4a00b0d49eca8dea471074"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3777ce5536d17989c91696db1d459574e9a9bd37660ea7ee4d3344579bb6f129"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fc5fc1eeb029757349ad26bbc5880557389a03fa6ada41703db5e068881e5f2"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ea65804b5dc88dacd4a40279af0cdadcfe74b3e5b4c897aa0d81cf86927fee78"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa102d6d280a5455ad6a0f9e6d769989638718e938a6a0a2ff3f4a7ff8c62cc4"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09efe4615ada057ba2d30df871d2f668af661e971dfeedf0c159927d48bbeff0"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:008d3e808d03ef28542372d01057fd09168419cdc8f848efe2804f894ae03e51"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:6f5cb257bc2ec58f437da2b37a8cd48f666db96d47b8a3115c29f316313654ff"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:992f18e0ea248ee03b5a6e8b3b4738850ae7dbb172cc41c966462801cbf62cf7"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:0e9d124c191d5b881060a9e5060627694c3bdd1fe24c5eecc8d5d7d0eb6faabc"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3986b6f41ad22988e53d5778f91855dc0399b043fc8946d4f2e68af22ee9ff10"}, + {file = "yarl-1.9.4-cp312-cp312-win32.whl", hash = "sha256:4b21516d181cd77ebd06ce160ef8cc2a5e9ad35fb1c5930882baff5ac865eee7"}, + {file = "yarl-1.9.4-cp312-cp312-win_amd64.whl", hash = "sha256:a9bd00dc3bc395a662900f33f74feb3e757429e545d831eef5bb280252631984"}, + {file = "yarl-1.9.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:63b20738b5aac74e239622d2fe30df4fca4942a86e31bf47a81a0e94c14df94f"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7d7f7de27b8944f1fee2c26a88b4dabc2409d2fea7a9ed3df79b67277644e17"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c74018551e31269d56fab81a728f683667e7c28c04e807ba08f8c9e3bba32f14"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ca06675212f94e7a610e85ca36948bb8fc023e458dd6c63ef71abfd482481aa5"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aef935237d60a51a62b86249839b51345f47564208c6ee615ed2a40878dccdd"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2b134fd795e2322b7684155b7855cc99409d10b2e408056db2b93b51a52accc7"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d25039a474c4c72a5ad4b52495056f843a7ff07b632c1b92ea9043a3d9950f6e"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:f7d6b36dd2e029b6bcb8a13cf19664c7b8e19ab3a58e0fefbb5b8461447ed5ec"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:957b4774373cf6f709359e5c8c4a0af9f6d7875db657adb0feaf8d6cb3c3964c"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:d7eeb6d22331e2fd42fce928a81c697c9ee2d51400bd1a28803965883e13cead"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:6a962e04b8f91f8c4e5917e518d17958e3bdee71fd1d8b88cdce74dd0ebbf434"}, + {file = "yarl-1.9.4-cp37-cp37m-win32.whl", hash = "sha256:f3bc6af6e2b8f92eced34ef6a96ffb248e863af20ef4fde9448cc8c9b858b749"}, + {file = "yarl-1.9.4-cp37-cp37m-win_amd64.whl", hash = "sha256:ad4d7a90a92e528aadf4965d685c17dacff3df282db1121136c382dc0b6014d2"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ec61d826d80fc293ed46c9dd26995921e3a82146feacd952ef0757236fc137be"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8be9e837ea9113676e5754b43b940b50cce76d9ed7d2461df1af39a8ee674d9f"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bef596fdaa8f26e3d66af846bbe77057237cb6e8efff8cd7cc8dff9a62278bbf"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d47552b6e52c3319fede1b60b3de120fe83bde9b7bddad11a69fb0af7db32f1"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84fc30f71689d7fc9168b92788abc977dc8cefa806909565fc2951d02f6b7d57"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4aa9741085f635934f3a2583e16fcf62ba835719a8b2b28fb2917bb0537c1dfa"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:206a55215e6d05dbc6c98ce598a59e6fbd0c493e2de4ea6cc2f4934d5a18d130"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07574b007ee20e5c375a8fe4a0789fad26db905f9813be0f9fef5a68080de559"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5a2e2433eb9344a163aced6a5f6c9222c0786e5a9e9cac2c89f0b28433f56e23"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:6ad6d10ed9b67a382b45f29ea028f92d25bc0bc1daf6c5b801b90b5aa70fb9ec"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:6fe79f998a4052d79e1c30eeb7d6c1c1056ad33300f682465e1b4e9b5a188b78"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:a825ec844298c791fd28ed14ed1bffc56a98d15b8c58a20e0e08c1f5f2bea1be"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8619d6915b3b0b34420cf9b2bb6d81ef59d984cb0fde7544e9ece32b4b3043c3"}, + {file = "yarl-1.9.4-cp38-cp38-win32.whl", hash = "sha256:686a0c2f85f83463272ddffd4deb5e591c98aac1897d65e92319f729c320eece"}, + {file = "yarl-1.9.4-cp38-cp38-win_amd64.whl", hash = "sha256:a00862fb23195b6b8322f7d781b0dc1d82cb3bcac346d1e38689370cc1cc398b"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:604f31d97fa493083ea21bd9b92c419012531c4e17ea6da0f65cacdcf5d0bd27"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8a854227cf581330ffa2c4824d96e52ee621dd571078a252c25e3a3b3d94a1b1"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ba6f52cbc7809cd8d74604cce9c14868306ae4aa0282016b641c661f981a6e91"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6327976c7c2f4ee6816eff196e25385ccc02cb81427952414a64811037bbc8b"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8397a3817d7dcdd14bb266283cd1d6fc7264a48c186b986f32e86d86d35fbac5"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e0381b4ce23ff92f8170080c97678040fc5b08da85e9e292292aba67fdac6c34"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:23d32a2594cb5d565d358a92e151315d1b2268bc10f4610d098f96b147370136"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ddb2a5c08a4eaaba605340fdee8fc08e406c56617566d9643ad8bf6852778fc7"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:26a1dc6285e03f3cc9e839a2da83bcbf31dcb0d004c72d0730e755b33466c30e"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:18580f672e44ce1238b82f7fb87d727c4a131f3a9d33a5e0e82b793362bf18b4"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:29e0f83f37610f173eb7e7b5562dd71467993495e568e708d99e9d1944f561ec"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:1f23e4fe1e8794f74b6027d7cf19dc25f8b63af1483d91d595d4a07eca1fb26c"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:db8e58b9d79200c76956cefd14d5c90af54416ff5353c5bfd7cbe58818e26ef0"}, + {file = "yarl-1.9.4-cp39-cp39-win32.whl", hash = "sha256:c7224cab95645c7ab53791022ae77a4509472613e839dab722a72abe5a684575"}, + {file = "yarl-1.9.4-cp39-cp39-win_amd64.whl", hash = "sha256:824d6c50492add5da9374875ce72db7a0733b29c2394890aef23d533106e2b15"}, + {file = "yarl-1.9.4-py3-none-any.whl", hash = "sha256:928cecb0ef9d5a7946eb6ff58417ad2fe9375762382f1bf5c55e61645f2c43ad"}, + {file = "yarl-1.9.4.tar.gz", hash = "sha256:566db86717cf8080b99b58b083b773a908ae40f06681e87e589a976faf8246bf"}, ] [package.dependencies] idna = ">=2.0" multidict = ">=4.0" -typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} [[package]] name = "zipp" -version = "3.10.0" +version = "3.19.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "zipp-3.10.0-py3-none-any.whl", hash = "sha256:4fcb6f278987a6605757302a6e40e896257570d11c51628968ccb2a47e80c6c1"}, - {file = "zipp-3.10.0.tar.gz", hash = "sha256:7a7262fd930bd3e36c50b9a64897aec3fafff3dfdeec9623ae22b40e93f99bb8"}, + {file = "zipp-3.19.0-py3-none-any.whl", hash = "sha256:96dc6ad62f1441bcaccef23b274ec471518daf4fbbc580341204936a5a3dddec"}, + {file = "zipp-3.19.0.tar.gz", hash = "sha256:952df858fb3164426c976d9338d3961e8e8b3758e2e059e0f754b8c4262625ee"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] -testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [extras] aio = ["aiohttp"] [metadata] lock-version = "2.0" -python-versions = "^3.7.2" -content-hash = "dfb82fd74cb6f860a7ce983f927a99881e64a8c3fd657623e06523bab230ebb6" +python-versions = "^3.8.0" +content-hash = "e54ece8c27af8b4437d0a85c73bed419ebfab48de6b78109a07992dea8506912" diff --git a/pyproject.toml b/pyproject.toml index 79c51b4d..1bb28710 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "^3.7.2" +python = "^3.8.0" azure-core = ">=1.24.0" azure-identity = ">=1.5.0" isodate = ">=0.6.1" diff --git a/src/pydo/__init__.py b/src/pydo/__init__.py index 439752d8..411dc25c 100644 --- a/src/pydo/__init__.py +++ b/src/pydo/__init__.py @@ -1,6 +1,6 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -11,12 +11,14 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["GeneratedClient"] +__all__ = [ + "GeneratedClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/src/pydo/_client.py b/src/pydo/_client.py index 4b92d86c..a9522878 100644 --- a/src/pydo/_client.py +++ b/src/pydo/_client.py @@ -1,6 +1,6 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -8,6 +8,7 @@ from typing import Any, TYPE_CHECKING from azure.core import PipelineClient +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse from ._configuration import GeneratedClientConfiguration @@ -51,8 +52,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials import TokenCredential @@ -190,9 +189,9 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too if a collection was processed. For example, if you send a GET request to ``/v2/droplets/$DROPLET_ID`` you - will get back an object with a key called "\ ``droplet``\ ". However, if you send - the GET request to the general collection at ``/v2/droplets``\ , you will get - back an object with a key called "\ ``droplets``\ ". + will get back an object with a key called "\\ ``droplet``\\ ". However, if you send + the GET request to the general collection at ``/v2/droplets``\\ , you will get + back an object with a key called "\\ ``droplets``\\ ". The value of these keys will generally be a JSON object for a request on a single object and an array of objects for a request on a collection of @@ -240,7 +239,7 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too The ``meta`` object will only be displayed when it has a value. Currently, the ``meta`` object will have a value when a request is made on a collection (like - ``droplets`` or ``domains``\ ). + ``droplets`` or ``domains``\\ ). Sample Meta Object ^^^^^^^^^^^^^^^^^^ @@ -276,10 +275,10 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too following: - * **first**\ : The URI of the first page of results. - * **prev**\ : The URI of the previous sequential page of results. - * **next**\ : The URI of the next sequential page of results. - * **last**\ : The URI of the last page of results. + * **first**\\ : The URI of the first page of results. + * **prev**\\ : The URI of the previous sequential page of results. + * **next**\\ : The URI of the next sequential page of results. + * **last**\\ : The URI of the last page of results. The ``pages`` object will only include the links that make sense. So for the first page of results, no ``first`` or ``prev`` links will ever be set. This @@ -318,17 +317,17 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too each request. The relevant headers are: - * **ratelimit-limit**\ : The number of requests that can be made per hour. - * **ratelimit-remaining**\ : The number of requests that remain before you hit your request + * **ratelimit-limit**\\ : The number of requests that can be made per hour. + * **ratelimit-remaining**\\ : The number of requests that remain before you hit your request limit. See the information below for how the request limits expire. - * **ratelimit-reset**\ : This represents the time when the oldest request will expire. The + * **ratelimit-reset**\\ : This represents the time when the oldest request will expire. The value is given in `Unix epoch time `_. See below for more information about how request limits expire. More rate limiting information is returned only within burst limit error response headers: - * **retry-after**\ : The number of seconds to wait before making another request when rate + * **retry-after**\\ : The number of seconds to wait before making another request when rate limited. As long as the ``ratelimit-remaining`` count is above zero, you will be able @@ -369,8 +368,8 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too * Only 10 ``GET`` requests to the ``/v2/account/keys`` endpoint to list SSH keys can be made per 60 seconds. * Only 5 requests to any and all ``v2/cdn/endpoints`` can be made per 10 seconds. This includes - ``v2/cdn/endpoints``\ , - ``v2/cdn/endpoints/$ENDPOINT_ID``\ , and ``v2/cdn/endpoints/$ENDPOINT_ID/cache``. + ``v2/cdn/endpoints``\\ , + ``v2/cdn/endpoints/$ENDPOINT_ID``\\ , and ``v2/cdn/endpoints/$ENDPOINT_ID/cache``. * Only 50 strings within the ``files`` json struct in the ``v2/cdn/endpoints/$ENDPOINT_ID/cache`` `payload `_ @@ -424,20 +423,20 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too * For cmd.exe, use the ``set VAR=VALUE`` `syntax `_ - to define environment variables, call them with ``%VAR%``\ , then replace all backslashes (\ - ``\``\ ) in the examples with carets (\ ``^``\ ). + to define environment variables, call them with ``%VAR%``\\ , then replace all backslashes + (\\ ``\\``\\ ) in the examples with carets (\\ ``^``\\ ). * For PowerShell, use the ``$Env:VAR = "VALUE"`` `syntax `_ - to define environment variables, call them with ``$Env:VAR``\ , then replace ``curl`` with - ``curl.exe`` and all backslashes (\ ``\``\ ) in the examples with backticks (\ ``` ``\ ). + to define environment variables, call them with ``$Env:VAR``\\ , then replace ``curl`` with + ``curl.exe`` and all backslashes (\\ ``\\``\\ ) in the examples with backticks (\\ ``` ``\\ ). * WSL is a compatibility layer that allows you to emulate a Linux terminal on a Windows machine. Install WSL with our `community tutorial - `_\ + `_\\ , then follow this API documentation normally. @@ -465,7 +464,7 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too If you are following along, make sure you use a Droplet ID that you control so that your commands will execute correctly. - If you need access to the headers of a response through ``curl``\ , you can pass + If you need access to the headers of a response through ``curl``\\ , you can pass the ``-i`` flag to display the header information along with the body. If you are only interested in the header, you can instead pass the ``-I`` flag, which will exclude the response body entirely. @@ -511,9 +510,9 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too .. code-block:: - curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"name": "example.com", "ip_address": "127.0.0.1"}' \ + curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \\ + -H "Content-Type: application/json" \\ + -d '{"name": "example.com", "ip_address": "127.0.0.1"}' \\ -X POST "https://api.digitalocean.com/v2/domains" Pass Filter Parameters as a Query String @@ -521,8 +520,8 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too .. code-block:: - curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ - -X GET \ + curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \\ + -X GET \\ "https://api.digitalocean.com/v2/images?private=true" Cross Origin Resource Sharing @@ -548,16 +547,16 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too that will be set to show the constraints are: - * **Access-Control-Allow-Origin**\ : This is the domain that is sent by the client or browser + * **Access-Control-Allow-Origin**\\ : This is the domain that is sent by the client or browser as the origin of the request. It is set through an ``Origin`` header. - * **Access-Control-Allow-Methods**\ : This specifies the allowed options for requests from that - domain. This will generally be all available methods. - * **Access-Control-Expose-Headers**\ : This will contain the headers that will be available to + * **Access-Control-Allow-Methods**\\ : This specifies the allowed options for requests from + that domain. This will generally be all available methods. + * **Access-Control-Expose-Headers**\\ : This will contain the headers that will be available to requests from the origin domain. - * **Access-Control-Max-Age**\ : This is the length of time that the access is considered valid. - After this expires, a new preflight should be sent. - * **Access-Control-Allow-Credentials**\ : This will be set to ``true``. It basically allows you - to send your OAuth token for authentication. + * **Access-Control-Max-Age**\\ : This is the length of time that the access is considered + valid. After this expires, a new preflight should be sent. + * **Access-Control-Allow-Credentials**\\ : This will be set to ``true``. It basically allows + you to send your OAuth token for authentication. You should not need to be concerned with the details of these headers, because the browser will typically do all of the work for you. @@ -644,7 +643,28 @@ def __init__( **kwargs: Any ) -> None: self._config = GeneratedClientConfiguration(credential=credential, **kwargs) - self._client = PipelineClient(base_url=endpoint, config=self._config, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) + if self._config.redirect_policy + else None, + self._config.http_logging_policy, + ] + self._client: PipelineClient = PipelineClient( + base_url=endpoint, policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() @@ -752,7 +772,9 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) - def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -772,17 +794,14 @@ def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> GeneratedClient + def __enter__(self) -> "GeneratedClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/src/pydo/_configuration.py b/src/pydo/_configuration.py index 5b76c333..fadda319 100644 --- a/src/pydo/_configuration.py +++ b/src/pydo/_configuration.py @@ -1,12 +1,11 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from ._version import VERSION @@ -16,9 +15,7 @@ from azure.core.credentials import TokenCredential -class GeneratedClientConfiguration( - Configuration -): # pylint: disable=too-many-instance-attributes +class GeneratedClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for GeneratedClient. Note that all parameters used to create this instance are saved as instance @@ -29,7 +26,6 @@ class GeneratedClientConfiguration( """ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: - super(GeneratedClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -38,12 +34,10 @@ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: "credential_scopes", ["https://api.digitalocean.com"] ) kwargs.setdefault("sdk_moniker", "generatedclient/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get( "user_agent_policy" ) or policies.UserAgentPolicy(**kwargs) @@ -57,13 +51,13 @@ def _configure( self.http_logging_policy = kwargs.get( "http_logging_policy" ) or policies.HttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get( "custom_hook_policy" ) or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy( **kwargs ) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = policies.BearerTokenCredentialPolicy( diff --git a/src/pydo/_serialization.py b/src/pydo/_serialization.py index a0863277..0a3bb323 100644 --- a/src/pydo/_serialization.py +++ b/src/pydo/_serialization.py @@ -25,6 +25,7 @@ # -------------------------------------------------------------------------- # pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode import calendar @@ -37,27 +38,38 @@ import re import sys import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore except ImportError: - from urllib.parse import quote # type: ignore + from urllib.parse import quote import xml.etree.ElementTree as ET -import isodate - -from typing import Dict, Any, cast, TYPE_CHECKING +import isodate # type: ignore -from azure.core.exceptions import ( - DeserializationError, - SerializationError, - raise_with_traceback, -) +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -if TYPE_CHECKING: - from typing import Optional, Union, AnyStr, IO, Mapping +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] class RawDeserializer: @@ -69,8 +81,9 @@ class RawDeserializer: CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data, content_type=None): - # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + def deserialize_from_text( + cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None + ) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -113,7 +126,7 @@ def deserialize_from_text(cls, data, content_type=None): pass return ET.fromstring(data_as_str) # nosec - except ET.ParseError: + except ET.ParseError as err: # It might be because the server has an issue, and returned JSON with # content-type XML.... # So let's try a JSON load, and if it's still broken @@ -132,14 +145,15 @@ def _json_attemp(data): # The function hack is because Py2.7 messes up with exception # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") - raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("XML is invalid") from err raise DeserializationError( "Cannot deserialize content-type: {}".format(content_type) ) @classmethod - def deserialize_from_http_generics(cls, body_bytes, headers): - # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + def deserialize_from_http_generics( + cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping + ) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -162,13 +176,6 @@ def deserialize_from_http_generics(cls, body_bytes, headers): return None -try: - basestring # type: ignore - unicode_str = unicode # type: ignore -except NameError: - basestring = str # type: ignore - unicode_str = str # type: ignore - _LOGGER = logging.getLogger(__name__) try: @@ -194,7 +201,7 @@ def dst(self, dt): try: - from datetime import timezone as _FixedOffset + from datetime import timezone as _FixedOffset # type: ignore except ImportError: # Python 2.7 class _FixedOffset(datetime.tzinfo): # type: ignore @@ -225,7 +232,7 @@ def __getinitargs__(self): try: from datetime import timezone - TZ_UTC = timezone.utc # type: ignore + TZ_UTC = timezone.utc except ImportError: TZ_UTC = UTC() # type: ignore @@ -282,12 +289,12 @@ class Model(object): serialization and deserialization. """ - _subtype_map = {} # type: Dict[str, Dict[str, Any]] - _attribute_map = {} # type: Dict[str, Dict[str, Any]] - _validation = {} # type: Dict[str, Dict[str, Any]] + _subtype_map: Dict[str, Dict[str, Any]] = {} + _attribute_map: Dict[str, Dict[str, Any]] = {} + _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Optional[Dict[str, Any]] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning( @@ -304,27 +311,27 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: - cls._xml_map + cls._xml_map # type: ignore except AttributeError: return False return True @@ -333,7 +340,7 @@ def is_xml_model(cls): def _create_xml_node(cls): """Create XML node.""" try: - xml_map = cls._xml_map + xml_map = cls._xml_map # type: ignore except AttributeError: xml_map = {} @@ -343,8 +350,8 @@ def _create_xml_node(cls): xml_map.get("ns", None), ) - def serialize(self, keep_readonly=False, **kwargs): - """Return the JSON that would be sent to azure from this model. + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -355,12 +362,17 @@ def serialize(self, keep_readonly=False, **kwargs): :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore def as_dict( - self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs - ): - """Return a dict that can be JSONify using json.dump. + self, + keep_readonly: bool = True, + key_transformer: Callable[ + [str, Dict[str, Any], Any], Any + ] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -391,9 +403,7 @@ def my_key_transformer(key, attr_desc, value): :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize( - self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs - ) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore @classmethod def _infer_class_models(cls): @@ -411,7 +421,9 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize( + cls: Type[ModelType], data: Any, content_type: Optional[str] = None + ) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -420,10 +432,15 @@ def deserialize(cls, data, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -436,8 +453,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -445,7 +462,7 @@ def from_dict(cls, data, key_extractors=None, content_type=None): if key_extractors is None else key_extractors ) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def _flatten_subtype(cls, key, objects): @@ -481,7 +498,7 @@ def _classify(cls, response, objects): return cls flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) try: - return objects[flatten_mapping_type[subtype_value]] + return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: _LOGGER.warning( "Subtype value %s has no mapping, use base class %s.", @@ -553,7 +570,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, type]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -569,7 +586,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -645,14 +662,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): - serialized.text = new_attr + serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): - serialized.extend(new_attr) + serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): @@ -661,32 +678,32 @@ def _serialize(self, target_obj, data_type=None, **kwargs): new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name - serialized.append(new_attr) + serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = unicode_str(new_attr) - serialized.append(local_node) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore else: # JSON - for k in reversed(keys): - unflattened = {k: new_attr} - new_attr = unflattened + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized - for k in keys: + for k in keys: # type: ignore if k not in _serialized: - _serialized.update(_new_attr) - _new_attr = _new_attr[k] + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format( attr_name, class_name, str(target_obj) ) - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err else: return serialized @@ -701,8 +718,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -719,7 +736,7 @@ def body(self, data, data_type, **kwargs): # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: - deserializer.key_extractors = [ + deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: @@ -730,9 +747,9 @@ def body(self, data, data_type, **kwargs): ] data = deserializer._deserialize(data_type, data) except DeserializationError as err: - raise_with_traceback( - SerializationError, "Unable to build a model: " + str(err), err - ) + raise SerializationError( + "Unable to build a model: " + str(err) + ) from err return self._serialize(data, data_type, **kwargs) @@ -752,6 +769,7 @@ def url(self, name, data, data_type, **kwargs): if kwargs.get("skip_quote") is True: output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") except SerializationError: @@ -764,7 +782,9 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. - :rtype: str + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. + :rtype: str, list :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -772,15 +792,10 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [ - self.serialize_data(d, internal_data_type, **kwargs) - if d is not None - else "" - for d in data - ] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter( + data, internal_data_type, do_quote=do_quote, **kwargs + ) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -831,6 +846,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is CoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -849,7 +866,7 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." - raise_with_traceback(SerializationError, msg.format(data, data_type), err) + raise SerializationError(msg.format(data, data_type)) from err else: return self._serialize(data, **kwargs) @@ -894,7 +911,7 @@ def serialize_unicode(cls, data): pass try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data @@ -917,6 +934,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -929,9 +948,16 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = [ + "" if s is None else quote(str(s), safe="") for s in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -984,7 +1010,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): serialized[self.serialize_unicode(key)] = self.serialize_data( value, dict_type, **kwargs ) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: @@ -1019,7 +1047,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) if obj_type is _long_type: return self.serialize_long(attr) - if obj_type is unicode_str: + if obj_type is str: return self.serialize_unicode(attr) if obj_type is datetime.datetime: return self.serialize_iso(attr) @@ -1064,10 +1092,10 @@ def serialize_enum(attr, enum_obj=None): except AttributeError: result = attr try: - enum_obj(result) + enum_obj(result) # type: ignore return result except ValueError: - for enum_value in enum_obj: + for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" @@ -1203,10 +1231,10 @@ def serialize_iso(attr, **kwargs): return date + microseconds + "Z" except (ValueError, OverflowError) as err: msg = "Unable to serialize datetime object." - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err except AttributeError as err: msg = "ISO-8601 object must be valid Datetime object." - raise_with_traceback(TypeError, msg, err) + raise TypeError(msg) from err @staticmethod def serialize_unix(attr, **kwargs): @@ -1232,7 +1260,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1241,7 +1270,6 @@ def rest_key_extractor(attr, attr_desc, data): if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1264,7 +1292,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1315,7 +1342,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1339,7 +1366,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): @@ -1414,7 +1441,7 @@ class Deserializer(object): r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?" ) - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, type]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1434,7 +1461,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1493,7 +1520,7 @@ def _deserialize(self, target_obj, data): response, class_name = self._classify_target(target_obj, data) - if isinstance(response, basestring): + if isinstance(response, str): return self.deserialize_data(data, response) elif isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) @@ -1501,7 +1528,7 @@ def _deserialize(self, target_obj, data): if data is None: return data try: - attributes = response._attribute_map + attributes = response._attribute_map # type: ignore d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1529,8 +1556,8 @@ def _deserialize(self, target_obj, data): value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name - raise_with_traceback(DeserializationError, msg, err) + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err else: additional_properties = self._build_additional_properties(attributes, data) return self._instantiate_model(response, d_attrs, additional_properties) @@ -1562,22 +1589,22 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None - if isinstance(target, basestring): + if isinstance(target, str): try: target = self.dependencies[target] except KeyError: return target, target try: - target = target._classify(data, self.dependencies) + target = target._classify(data, self.dependencies) # type: ignore except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1587,13 +1614,13 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: return self(target_obj, data, content_type=content_type) except: - _LOGGER.warning( + _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True, ) @@ -1637,8 +1664,8 @@ def _unpack_content(raw_data, content_type=None): raw_data.text, raw_data.headers ) - if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): @@ -1668,9 +1695,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): response_obj.additional_properties = additional_properties return response_obj except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format( - kwargs, response - ) + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) else: try: @@ -1727,7 +1752,7 @@ def deserialize_data(self, data, data_type): except (ValueError, TypeError, AttributeError) as err: msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return self._deserialize(obj_type, data) @@ -1783,7 +1808,7 @@ def deserialize_object(self, attr, **kwargs): if isinstance(attr, ET.Element): # Do no recurse on XML, just return the tree as-is return attr - if isinstance(attr, basestring): + if isinstance(attr, str): return self.deserialize_basic(attr, "str") obj_type = type(attr) if obj_type in self.basic_types: @@ -1840,7 +1865,7 @@ def deserialize_basic(self, attr, data_type): if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, basestring): + elif isinstance(attr, str): if attr.lower() in ["true", "1"]: return True elif attr.lower() in ["false", "0"]: @@ -1866,7 +1891,7 @@ def deserialize_unicode(data): # Consider this is real string try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) @@ -1891,7 +1916,6 @@ def deserialize_enum(data, enum_obj): data = data.value if isinstance(data, int): # Workaround. We might consider remove it in the future. - # https://github.com/Azure/azure-rest-api-specs/issues/141 try: return list(enum_obj.__members__.values())[data] except IndexError: @@ -1921,7 +1945,7 @@ def deserialize_bytearray(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return bytearray(b64decode(attr)) + return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): @@ -1933,8 +1957,8 @@ def deserialize_base64(attr): """ if isinstance(attr, ET.Element): attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) - attr = attr + padding + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @@ -1949,10 +1973,10 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) + return decimal.Decimal(str(attr)) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err @staticmethod def deserialize_long(attr): @@ -1964,7 +1988,7 @@ def deserialize_long(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return _long_type(attr) + return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): @@ -1980,7 +2004,7 @@ def deserialize_duration(attr): duration = isodate.parse_duration(attr) except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return duration @@ -1994,12 +2018,12 @@ def deserialize_date(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError( "Date must have only digits and -. Received: %s" % attr ) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) @staticmethod def deserialize_time(attr): @@ -2011,7 +2035,7 @@ def deserialize_time(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError( "Date must have only digits and -. Received: %s" % attr ) @@ -2028,7 +2052,7 @@ def deserialize_rfc(attr): if isinstance(attr, ET.Element): attr = attr.text try: - parsed_date = email.utils.parsedate_tz(attr) + parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( *parsed_date[:6], tzinfo=_FixedOffset( @@ -2039,7 +2063,7 @@ def deserialize_rfc(attr): date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj @@ -2054,7 +2078,7 @@ def deserialize_iso(attr): if isinstance(attr, ET.Element): attr = attr.text try: - attr = attr.upper() + attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) @@ -2076,7 +2100,7 @@ def deserialize_iso(attr): raise OverflowError("Hit max or min date") except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj @@ -2090,11 +2114,12 @@ def deserialize_unix(attr): :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): - attr = int(attr.text) + attr = int(attr.text) # type: ignore try: + attr = int(attr) date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: msg = "Cannot deserialize to unix datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj diff --git a/src/pydo/_vendor.py b/src/pydo/_vendor.py deleted file mode 100644 index 05928d12..00000000 --- a/src/pydo/_vendor.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/src/pydo/_version.py b/src/pydo/_version.py index d77069ed..d7d151fa 100644 --- a/src/pydo/_version.py +++ b/src/pydo/_version.py @@ -1,6 +1,6 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/src/pydo/aio/__init__.py b/src/pydo/aio/__init__.py index e2ca6719..d3564a0d 100644 --- a/src/pydo/aio/__init__.py +++ b/src/pydo/aio/__init__.py @@ -1,6 +1,6 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -8,12 +8,14 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["GeneratedClient"] +__all__ = [ + "GeneratedClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/src/pydo/aio/_client.py b/src/pydo/aio/_client.py index 5d9001a7..aee0a269 100644 --- a/src/pydo/aio/_client.py +++ b/src/pydo/aio/_client.py @@ -1,6 +1,6 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -8,6 +8,7 @@ from typing import Any, Awaitable, TYPE_CHECKING from azure.core import AsyncPipelineClient +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer @@ -51,8 +52,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials_async import AsyncTokenCredential @@ -190,9 +189,9 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too if a collection was processed. For example, if you send a GET request to ``/v2/droplets/$DROPLET_ID`` you - will get back an object with a key called "\ ``droplet``\ ". However, if you send - the GET request to the general collection at ``/v2/droplets``\ , you will get - back an object with a key called "\ ``droplets``\ ". + will get back an object with a key called "\\ ``droplet``\\ ". However, if you send + the GET request to the general collection at ``/v2/droplets``\\ , you will get + back an object with a key called "\\ ``droplets``\\ ". The value of these keys will generally be a JSON object for a request on a single object and an array of objects for a request on a collection of @@ -240,7 +239,7 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too The ``meta`` object will only be displayed when it has a value. Currently, the ``meta`` object will have a value when a request is made on a collection (like - ``droplets`` or ``domains``\ ). + ``droplets`` or ``domains``\\ ). Sample Meta Object ^^^^^^^^^^^^^^^^^^ @@ -276,10 +275,10 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too following: - * **first**\ : The URI of the first page of results. - * **prev**\ : The URI of the previous sequential page of results. - * **next**\ : The URI of the next sequential page of results. - * **last**\ : The URI of the last page of results. + * **first**\\ : The URI of the first page of results. + * **prev**\\ : The URI of the previous sequential page of results. + * **next**\\ : The URI of the next sequential page of results. + * **last**\\ : The URI of the last page of results. The ``pages`` object will only include the links that make sense. So for the first page of results, no ``first`` or ``prev`` links will ever be set. This @@ -318,17 +317,17 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too each request. The relevant headers are: - * **ratelimit-limit**\ : The number of requests that can be made per hour. - * **ratelimit-remaining**\ : The number of requests that remain before you hit your request + * **ratelimit-limit**\\ : The number of requests that can be made per hour. + * **ratelimit-remaining**\\ : The number of requests that remain before you hit your request limit. See the information below for how the request limits expire. - * **ratelimit-reset**\ : This represents the time when the oldest request will expire. The + * **ratelimit-reset**\\ : This represents the time when the oldest request will expire. The value is given in `Unix epoch time `_. See below for more information about how request limits expire. More rate limiting information is returned only within burst limit error response headers: - * **retry-after**\ : The number of seconds to wait before making another request when rate + * **retry-after**\\ : The number of seconds to wait before making another request when rate limited. As long as the ``ratelimit-remaining`` count is above zero, you will be able @@ -369,8 +368,8 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too * Only 10 ``GET`` requests to the ``/v2/account/keys`` endpoint to list SSH keys can be made per 60 seconds. * Only 5 requests to any and all ``v2/cdn/endpoints`` can be made per 10 seconds. This includes - ``v2/cdn/endpoints``\ , - ``v2/cdn/endpoints/$ENDPOINT_ID``\ , and ``v2/cdn/endpoints/$ENDPOINT_ID/cache``. + ``v2/cdn/endpoints``\\ , + ``v2/cdn/endpoints/$ENDPOINT_ID``\\ , and ``v2/cdn/endpoints/$ENDPOINT_ID/cache``. * Only 50 strings within the ``files`` json struct in the ``v2/cdn/endpoints/$ENDPOINT_ID/cache`` `payload `_ @@ -424,20 +423,20 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too * For cmd.exe, use the ``set VAR=VALUE`` `syntax `_ - to define environment variables, call them with ``%VAR%``\ , then replace all backslashes (\ - ``\``\ ) in the examples with carets (\ ``^``\ ). + to define environment variables, call them with ``%VAR%``\\ , then replace all backslashes + (\\ ``\\``\\ ) in the examples with carets (\\ ``^``\\ ). * For PowerShell, use the ``$Env:VAR = "VALUE"`` `syntax `_ - to define environment variables, call them with ``$Env:VAR``\ , then replace ``curl`` with - ``curl.exe`` and all backslashes (\ ``\``\ ) in the examples with backticks (\ ``` ``\ ). + to define environment variables, call them with ``$Env:VAR``\\ , then replace ``curl`` with + ``curl.exe`` and all backslashes (\\ ``\\``\\ ) in the examples with backticks (\\ ``` ``\\ ). * WSL is a compatibility layer that allows you to emulate a Linux terminal on a Windows machine. Install WSL with our `community tutorial - `_\ + `_\\ , then follow this API documentation normally. @@ -465,7 +464,7 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too If you are following along, make sure you use a Droplet ID that you control so that your commands will execute correctly. - If you need access to the headers of a response through ``curl``\ , you can pass + If you need access to the headers of a response through ``curl``\\ , you can pass the ``-i`` flag to display the header information along with the body. If you are only interested in the header, you can instead pass the ``-I`` flag, which will exclude the response body entirely. @@ -511,9 +510,9 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too .. code-block:: - curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"name": "example.com", "ip_address": "127.0.0.1"}' \ + curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \\ + -H "Content-Type: application/json" \\ + -d '{"name": "example.com", "ip_address": "127.0.0.1"}' \\ -X POST "https://api.digitalocean.com/v2/domains" Pass Filter Parameters as a Query String @@ -521,8 +520,8 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too .. code-block:: - curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ - -X GET \ + curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \\ + -X GET \\ "https://api.digitalocean.com/v2/images?private=true" Cross Origin Resource Sharing @@ -548,16 +547,16 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too that will be set to show the constraints are: - * **Access-Control-Allow-Origin**\ : This is the domain that is sent by the client or browser + * **Access-Control-Allow-Origin**\\ : This is the domain that is sent by the client or browser as the origin of the request. It is set through an ``Origin`` header. - * **Access-Control-Allow-Methods**\ : This specifies the allowed options for requests from that - domain. This will generally be all available methods. - * **Access-Control-Expose-Headers**\ : This will contain the headers that will be available to + * **Access-Control-Allow-Methods**\\ : This specifies the allowed options for requests from + that domain. This will generally be all available methods. + * **Access-Control-Expose-Headers**\\ : This will contain the headers that will be available to requests from the origin domain. - * **Access-Control-Max-Age**\ : This is the length of time that the access is considered valid. - After this expires, a new preflight should be sent. - * **Access-Control-Allow-Credentials**\ : This will be set to ``true``. It basically allows you - to send your OAuth token for authentication. + * **Access-Control-Max-Age**\\ : This is the length of time that the access is considered + valid. After this expires, a new preflight should be sent. + * **Access-Control-Allow-Credentials**\\ : This will be set to ``true``. It basically allows + you to send your OAuth token for authentication. You should not need to be concerned with the details of these headers, because the browser will typically do all of the work for you. @@ -644,8 +643,27 @@ def __init__( **kwargs: Any ) -> None: self._config = GeneratedClientConfiguration(credential=credential, **kwargs) - self._client = AsyncPipelineClient( - base_url=endpoint, config=self._config, **kwargs + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) + if self._config.redirect_policy + else None, + self._config.http_logging_policy, + ] + self._client: AsyncPipelineClient = AsyncPipelineClient( + base_url=endpoint, policies=_policies, **kwargs ) self._serialize = Serializer() @@ -755,7 +773,7 @@ def __init__( ) def send_request( - self, request: HttpRequest, **kwargs: Any + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -776,7 +794,7 @@ def send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() @@ -785,5 +803,5 @@ async def __aenter__(self) -> "GeneratedClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/src/pydo/aio/_configuration.py b/src/pydo/aio/_configuration.py index b4f17a5d..d87d69d0 100644 --- a/src/pydo/aio/_configuration.py +++ b/src/pydo/aio/_configuration.py @@ -1,12 +1,11 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from .._version import VERSION @@ -16,9 +15,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class GeneratedClientConfiguration( - Configuration -): # pylint: disable=too-many-instance-attributes +class GeneratedClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for GeneratedClient. Note that all parameters used to create this instance are saved as instance @@ -29,7 +26,6 @@ class GeneratedClientConfiguration( """ def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: - super(GeneratedClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -38,6 +34,7 @@ def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: "credential_scopes", ["https://api.digitalocean.com"] ) kwargs.setdefault("sdk_moniker", "generatedclient/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -54,15 +51,15 @@ def _configure(self, **kwargs: Any) -> None: self.http_logging_policy = kwargs.get( "http_logging_policy" ) or policies.HttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy( - **kwargs - ) self.custom_hook_policy = kwargs.get( "custom_hook_policy" ) or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get( "redirect_policy" ) or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy( + **kwargs + ) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy( diff --git a/src/pydo/aio/operations/__init__.py b/src/pydo/aio/operations/__init__.py index 1d6bd211..930e654c 100644 --- a/src/pydo/aio/operations/__init__.py +++ b/src/pydo/aio/operations/__init__.py @@ -1,6 +1,6 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -40,7 +40,7 @@ from ._operations import UptimeOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/src/pydo/aio/operations/_operations.py b/src/pydo/aio/operations/_operations.py index f4ceba1f..39f9ccb3 100644 --- a/src/pydo/aio/operations/_operations.py +++ b/src/pydo/aio/operations/_operations.py @@ -1,10 +1,11 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime +from io import IOBase import sys from typing import ( Any, @@ -13,6 +14,7 @@ Dict, IO, Optional, + Type, TypeVar, Union, cast, @@ -24,11 +26,11 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -396,10 +398,14 @@ async def list(self, *, type: Optional[str] = None, **kwargs: Any) -> JSON: ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -408,25 +414,28 @@ async def list(self, *, type: Optional[str] = None, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_one_clicks_list_request( + _request = build_one_clicks_list_request( type=type, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -446,14 +455,15 @@ async def list(self, *, type: Optional[str] = None, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def install_kubernetes( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Install Kubernetes 1-Click Applications. To install a Kubernetes 1-Click application on a cluster, send a POST request to @@ -491,7 +501,7 @@ async def install_kubernetes( @overload async def install_kubernetes( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: """Install Kubernetes 1-Click Applications. @@ -501,7 +511,7 @@ async def install_kubernetes( 1-Click Kubernetes applications, send a request to ``/v2/1-clicks?type=kubernetes``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -519,7 +529,10 @@ async def install_kubernetes( """ @distributed_trace_async - async def install_kubernetes(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def install_kubernetes( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Install Kubernetes 1-Click Applications. To install a Kubernetes 1-Click application on a cluster, send a POST request to @@ -527,11 +540,8 @@ async def install_kubernetes(self, body: Union[JSON, IO], **kwargs: Any) -> JSON parameter in order to specify which 1-Click application(s) to install. To list all available 1-Click Kubernetes applications, send a request to ``/v2/1-clicks?type=kubernetes``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -539,15 +549,29 @@ async def install_kubernetes(self, body: Union[JSON, IO], **kwargs: Any) -> JSON Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "addon_slugs": [ + "str" # An array of 1-Click Application slugs to be installed to the + Kubernetes cluster. Required. + ], + "cluster_uuid": "str" # A unique ID for the Kubernetes cluster to which the + 1-Click Applications will be installed. Required. + } + # response body for status code(s): 200 response == { "message": "str" # Optional. A message about the result of the request. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -556,38 +580,41 @@ async def install_kubernetes(self, body: Union[JSON, IO], **kwargs: Any) -> JSON _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_one_clicks_install_kubernetes_request( + _request = build_one_clicks_install_kubernetes_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -607,9 +634,9 @@ async def install_kubernetes(self, body: Union[JSON, IO], **kwargs: Any) -> JSON deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class AccountOperations: @@ -633,6 +660,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get User Information. To show information about the current user account, send a GET request to ``/v2/account``. @@ -655,26 +683,30 @@ async def get(self, **kwargs: Any) -> JSON: has verified their account via email. False otherwise. Required. "floating_ip_limit": 0, # The total number of Floating IPs the current user or team may have. Required. - "name": "str", # Optional. The display name for the current user. "status": "active", # Default value is "active". This value is one of "active", "warning" or "locked". Known values are: "active", "warning", and "locked". "status_message": "str", # A human-readable message giving more details about the status of the account. Required. + "uuid": "str", # The unique universal identifier for the current + user. Required. + "name": "str", # Optional. The display name for the current user. "team": { "name": "str", # Optional. The name for the current team. "uuid": "str" # Optional. The unique universal identifier for the current team. - }, - "uuid": "str" # The unique universal identifier for the current - user. Required. + } } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -683,24 +715,27 @@ async def get(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_account_get_request( + _request = build_account_get_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -720,9 +755,9 @@ async def get(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class SshKeysOperations: @@ -746,6 +781,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All SSH Keys. To list all of the keys in your account, send a GET request to ``/v2/account/keys``. The @@ -765,33 +801,37 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "ssh_keys": [ { + "name": "str", # A human-readable display name for this key, + used to easily identify the SSH keys when they are displayed. Required. + "public_key": "str", # The entire public key string that was + uploaded. Embedded into the root user's ``authorized_keys`` file if you + include this key during Droplet creation. Required. "fingerprint": "str", # Optional. A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this + "id": 0 # Optional. A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - "name": "str", # A human-readable display name for this key, - used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was - uploaded. Embedded into the root user's ``authorized_keys`` file if you - include this key during Droplet creation. Required. } ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -800,26 +840,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_ssh_keys_list_request( + _request = build_ssh_keys_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -839,14 +882,15 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New SSH Key. To add a new SSH public key to your DigitalOcean account, send a POST request to @@ -867,39 +911,40 @@ async def create( # JSON input template you can fill out and use as your body input. body = { - "fingerprint": "str", # Optional. A unique identifier that differentiates - this key from other keys using a format that SSH recognizes. The fingerprint is - created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. Can be - used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was uploaded. + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that differentiates + this key from other keys using a format that SSH recognizes. The fingerprint is + created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can be used + to embed a specific SSH key into a Droplet. } # response body for status code(s): 201 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } """ @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New SSH Key. To add a new SSH public key to your DigitalOcean account, send a POST request to @@ -907,7 +952,7 @@ async def create( ``public_key`` attribute to the full public key you are adding. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -921,33 +966,31 @@ async def create( # response body for status code(s): 201 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New SSH Key. To add a new SSH public key to your DigitalOcean account, send a POST request to ``/v2/account/keys``. Set the ``name`` attribute to the name you wish to use and the ``public_key`` attribute to the full public key you are adding. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -955,26 +998,44 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A human-readable display name for this key, used to easily + identify the SSH keys when they are displayed. Required. + "public_key": "str", # The entire public key string that was uploaded. + Embedded into the root user's ``authorized_keys`` file if you include this key + during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that differentiates + this key from other keys using a format that SSH recognizes. The fingerprint is + created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can be used + to embed a specific SSH key into a Droplet. + } + # response body for status code(s): 201 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -983,38 +1044,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_ssh_keys_create_request( + _request = build_ssh_keys_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -1034,12 +1098,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, ssh_key_identifier: JSON, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing SSH Key. To get information about a key, send a GET request to ``/v2/account/keys/$KEY_ID`` or @@ -1059,259 +1124,16 @@ async def get(self, ssh_key_identifier: JSON, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. - "name": "str", # A human-readable display name for this key, used to - easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was - uploaded. Embedded into the root user's ``authorized_keys`` file if you - include this key during Droplet creation. Required. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_ssh_keys_get_request( - ssh_key_identifier=ssh_key_identifier, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @overload - async def update( - self, - ssh_key_identifier: JSON, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - """Update an SSH Key's Name. - - To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` - or ``/v2/account/keys/$SSH_KEY_FINGERPRINT``. Set the ``name`` attribute to the new name you - want to use. - - :param ssh_key_identifier: Either the ID or the fingerprint of an existing SSH key. Required. - :type ssh_key_identifier: JSON - :param body: Set the ``name`` attribute to the new name you want to use. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "name": "str" # Optional. A human-readable display name for this key, used - to easily identify the SSH keys when they are displayed. - } - - # response body for status code(s): 200 - response == { - "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - async def update( - self, - ssh_key_identifier: JSON, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - """Update an SSH Key's Name. - - To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` - or ``/v2/account/keys/$SSH_KEY_FINGERPRINT``. Set the ``name`` attribute to the new name you - want to use. - - :param ssh_key_identifier: Either the ID or the fingerprint of an existing SSH key. Required. - :type ssh_key_identifier: JSON - :param body: Set the ``name`` attribute to the new name you want to use. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. - "name": "str", # A human-readable display name for this key, used to - easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was - uploaded. Embedded into the root user's ``authorized_keys`` file if you - include this key during Droplet creation. Required. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace_async - async def update( - self, ssh_key_identifier: JSON, body: Union[JSON, IO], **kwargs: Any - ) -> JSON: - """Update an SSH Key's Name. - - To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` - or ``/v2/account/keys/$SSH_KEY_FINGERPRINT``. Set the ``name`` attribute to the new name you - want to use. - - :param ssh_key_identifier: Either the ID or the fingerprint of an existing SSH key. Required. - :type ssh_key_identifier: JSON - :param body: Set the ``name`` attribute to the new name you want to use. Is either a model type - or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "ssh_key": { "fingerprint": "str", # Optional. A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. - "name": "str", # A human-readable display name for this key, used to - easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was - uploaded. Embedded into the root user's ``authorized_keys`` file if you - include this key during Droplet creation. Required. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } # response body for status code(s): 404 @@ -1326,51 +1148,44 @@ async def update( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_ssh_keys_update_request( + _request = build_ssh_keys_get_request( ssh_key_identifier=ssh_key_identifier, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -1407,12 +1222,283 @@ async def update( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore + + @overload + async def update( + self, + ssh_key_identifier: JSON, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update an SSH Key's Name. + + To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` + or ``/v2/account/keys/$SSH_KEY_FINGERPRINT``. Set the ``name`` attribute to the new name you + want to use. + + :param ssh_key_identifier: Either the ID or the fingerprint of an existing SSH key. Required. + :type ssh_key_identifier: JSON + :param body: Set the ``name`` attribute to the new name you want to use. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # Optional. A human-readable display name for this key, used + to easily identify the SSH keys when they are displayed. + } + + # response body for status code(s): 200 + response == { + "ssh_key": { + "name": "str", # A human-readable display name for this key, used to + easily identify the SSH keys when they are displayed. Required. + "public_key": "str", # The entire public key string that was + uploaded. Embedded into the root user's ``authorized_keys`` file if you + include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def update( + self, + ssh_key_identifier: JSON, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update an SSH Key's Name. + + To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` + or ``/v2/account/keys/$SSH_KEY_FINGERPRINT``. Set the ``name`` attribute to the new name you + want to use. + + :param ssh_key_identifier: Either the ID or the fingerprint of an existing SSH key. Required. + :type ssh_key_identifier: JSON + :param body: Set the ``name`` attribute to the new name you want to use. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "ssh_key": { + "name": "str", # A human-readable display name for this key, used to + easily identify the SSH keys when they are displayed. Required. + "public_key": "str", # The entire public key string that was + uploaded. Embedded into the root user's ``authorized_keys`` file if you + include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update( + self, ssh_key_identifier: JSON, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update an SSH Key's Name. + + To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` + or ``/v2/account/keys/$SSH_KEY_FINGERPRINT``. Set the ``name`` attribute to the new name you + want to use. + + :param ssh_key_identifier: Either the ID or the fingerprint of an existing SSH key. Required. + :type ssh_key_identifier: JSON + :param body: Set the ``name`` attribute to the new name you want to use. Is either a JSON type + or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # Optional. A human-readable display name for this key, used + to easily identify the SSH keys when they are displayed. + } + + # response body for status code(s): 200 + response == { + "ssh_key": { + "name": "str", # A human-readable display name for this key, used to + easily identify the SSH keys when they are displayed. Required. + "public_key": "str", # The entire public key string that was + uploaded. Embedded into the root user's ``authorized_keys`` file if you + include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_ssh_keys_update_request( + ssh_key_identifier=ssh_key_identifier, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, ssh_key_identifier: JSON, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an SSH Key. To destroy a public SSH key that you have in your account, send a DELETE request to @@ -1441,10 +1527,14 @@ async def delete(self, ssh_key_identifier: JSON, **kwargs: Any) -> Optional[JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -1453,25 +1543,28 @@ async def delete(self, ssh_key_identifier: JSON, **kwargs: Any) -> Optional[JSON _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_ssh_keys_delete_request( + _request = build_ssh_keys_delete_request( ssh_key_identifier=ssh_key_identifier, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -1504,9 +1597,9 @@ async def delete(self, ssh_key_identifier: JSON, **kwargs: Any) -> Optional[JSON deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class ActionsOperations: @@ -1530,6 +1623,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Actions. This will be the entire list of actions taken on your account, so it will be quite large. As @@ -1549,6 +1643,9 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -1590,16 +1687,17 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -1608,26 +1706,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_actions_list_request( + _request = build_actions_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -1647,12 +1748,13 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, action_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Action. To retrieve a specific action object, send a GET request to ``/v2/actions/$ACTION_ID``. @@ -1717,10 +1819,14 @@ async def get(self, action_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -1729,25 +1835,28 @@ async def get(self, action_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_actions_get_request( + _request = build_actions_get_request( action_id=action_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -1784,9 +1893,9 @@ async def get(self, action_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class AppsOperations: # pylint: disable=too-many-public-methods @@ -1817,6 +1926,7 @@ async def list( with_projects: Optional[bool] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Apps. List all apps on your account. Information about the current active deployment as well as any @@ -1838,220 +1948,285 @@ async def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "apps": [ { - "active_deployment": { - "cause": "str", # Optional. What caused this - deployment to be created. - "cloned_from": "str", # Optional. The ID of a - previous deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ { - "name": "str", # Optional. The name - of this functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this functions component. + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "domains": [ { - "name": "str", # Optional. The name - of this job. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this job. + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # - Optional. When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of - unsuccessful steps. - "pending_steps": 0, # Optional. Number of - pending steps. - "running_steps": 0, # Optional. Number of - currently running steps. - "steps": [ - { - "component_name": "str", # - Optional. The component name that this step is associated - with. - "ended_at": "2020-02-20 - 00:00:00", # Optional. The end time of this step. - "message_base": "str", # - Optional. The base of a human-readable description of the - step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". - "name": "str", # Optional. - The name of this step. - "reason": { - "code": "str", # - Optional. The error code. - "message": "str" # - Optional. The error message. - }, - "started_at": "2020-02-20 - 00:00:00", # Optional. The start time of this step. - "status": "UNKNOWN", # - Optional. Default value is "UNKNOWN". Known values are: - "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child - steps of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of - successful steps. - "summary_steps": [ - { - "component_name": "str", # - Optional. The component name that this step is associated - with. - "ended_at": "2020-02-20 - 00:00:00", # Optional. The end time of this step. - "message_base": "str", # - Optional. The base of a human-readable description of the - step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". - "name": "str", # Optional. - The name of this step. - "reason": { - "code": "str", # - Optional. The error code. - "message": "str" # - Optional. The error message. - }, - "started_at": "2020-02-20 - 00:00:00", # Optional. The start time of this step. - "status": "UNKNOWN", # - Optional. Default value is "UNKNOWN". Known values are: - "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child - steps of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of - steps. + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". }, - "services": [ + "functions": [ { - "name": "str", # Optional. The name - of this service. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # - Optional. The name of the underlying DigitalOcean DBaaS - cluster. This is required for production databases. For - dev databases, if cluster_name is not set, a new cluster - will be provisioned. - "db_name": "str", # - Optional. The name of the MySQL or PostgreSQL database to - configure. - "db_user": "str", # - Optional. The name of the MySQL or PostgreSQL user to - configure. - "engine": "UNSET", # - Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG: - PostgreSQL"n* REDIS: Redis. Known values are: "UNSET", - "MYSQL", "PG", and "REDIS". - "name": "str", # The name. - Must be unique across all components within the same app. - Required. - "production": bool, # - Optional. Whether this is a production or dev database. - "version": "str" # Optional. - The version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The - hostname for the domain. Required. - "minimum_tls_version": "str", - # Optional. The minimum version of TLS a client - application can use to access resources for the domain. - Must be one of the following values wrapped within - quotations: ``"1.2"`` or ``"1.3"``. Known values are: - "1.2" and "1.3". - "type": "UNSPECIFIED", # - Optional. Default value is "UNSPECIFIED". * DEFAULT: The - default ``.ondigitalocean.app`` domain assigned to this - app"n* PRIMARY: The primary domain for this app that is - displayed as the default in the control panel, used in - bindable environment variables, and any other places that - reference an app's live URL. Only one domain may be set - as primary."n* ALIAS: A non-primary domain. Known values - are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # - Optional. Indicates whether the domain includes all - sub-domains, in addition to the given domain. - "zone": "str" # Optional. - Optional. If the domain uses DigitalOcean DNS and you - would like App"nPlatform to automatically manage it for - you, set this to the name of the"ndomain on your - account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. - Default value is "AUTOASSIGN". The app egress type. Known - values are: "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "disabled": - bool, # Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default - value is "UNSPECIFIED_OPERATOR". Known values - are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, - # Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value - is "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", - "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR". + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the @@ -2098,758 +2273,1138 @@ async def list( request. This configures the ``Access-Control-Max-Age`` header. }, - "envs": [ - { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". }, - "name": "str", # The name. - Must be unique across all components within the same app. - Required. - "routes": [ - { - "path": - "str", # Optional. (Deprecated - Use Ingress - Rules instead). An HTTP path prefix. Paths must - start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. ], - "source_dir": "str" # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": - "str", # The name of the component to route to. - Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive - with ``rewrite``. - "rewrite": - "str" # Optional. An optional field that will - rewrite the path of the component to be what is - specified here. By default, the HTTP request path - will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If you specified the - rewrite to be ``/v1/``"" , requests to - ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": bool, # Optional. Whether - browsers should expose the response to the - client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" - # Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" - # Optional. The set of allowed HTTP methods. - This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" - , ``prefix``"" , or ``regex`` must be - set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" - , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 - syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" - # Optional. The set of HTTP response headers - that browsers are allowed to access. This - configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": - "str" # Optional. An optional duration - specifying how long browsers can cache the - results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": "str" # Prefix-based match. For - example, ``/api`` will match ``/api``"" , - ``/api/``"" , and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": - "str", # Optional. The authority/host to - redirect to. This can be a hostname or IP - address. Note: use ``port`` to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, # Optional. The redirect - code to use. Defaults to ``302``. Supported - values are 300, 301, 302, 303, 304, 307, 308. - "scheme": - "str", # Optional. The scheme to redirect to. - Supported values are ``http`` or ``https``. - Default: ``https``. - "uri": "str" - # Optional. An optional URI path to redirect to. - Note: if this is specified the whole URI of the - original request will be overwritten to this - value, irrespective of the original request URI - being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. + }, + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. - }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. + "logtail": { + "token": "str" # + Optional. Logtail token. }, - "instance_count": 1, # - Optional. Default value is 1. The amount of instances - that this component should be scaled to. Default: 1. Must - not be set if autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", - "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", - "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", - "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", - "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # - Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: - Default job type, will auto-complete to POST_DEPLOY - kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs - after an app deployment."n* FAILED_DEPLOY: Indicates a - job that runs after a component fails to deploy. Known - values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", - and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "run_command": "str", # - Optional. An optional run command to override the - component's default. - "source_dir": "str", # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The number of - seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate - shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "name": "str", # The name of the app. Must - be unique across all apps in the same account. Required. - "region": "str", # Optional. The slug form - of the geographical origin of the app. Default: ``nearest - available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", - "blr", "tor", "lon", and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "health_check": { - "failure_threshold": - 0, # Optional. The number of failed health checks - before considered unhealthy. - "http_path": "str", - # Optional. The route path used for the HTTP health - check ping. If not set, the HTTP health check will be - disabled and a TCP health check used instead. - "initial_delay_seconds": 0, # Optional. The number - of seconds to wait before beginning health checks. - "period_seconds": 0, - # Optional. The number of seconds to wait between - health checks. - "port": 0, # - Optional. The port on which the health check will be - performed. If not set, the health check will be - performed on the component's http_port. - "success_threshold": - 0, # Optional. The number of successful health - checks before considered healthy. - "timeout_seconds": 0 - # Optional. The number of seconds after which the - check times out. + "logtail": { + "token": "str" # + Optional. Logtail token. }, - "http_port": 0, # Optional. - The internal port on which this service's run command - will listen. Default: 8080"nIf there is not an - environment variable with the name ``PORT``"" , one will - be automatically added with its value set to the value of - this field. - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". }, - "instance_count": 1, # - Optional. Default value is 1. The amount of instances - that this component should be scaled to. Default: 1. Must - not be set if autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", - "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", - "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", - "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", - "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The - ports on which this service will listen for internal - traffic. - ], - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". - }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. } }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "routes": [ - { - "path": - "str", # Optional. (Deprecated - Use Ingress - Rules instead). An HTTP path prefix. Paths must - start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "run_command": "str", # - Optional. An optional run command to override the - component's default. - "source_dir": "str", # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - "termination": { - "drain_seconds": 0, - # Optional. The number of seconds to wait between - selecting a container instance for termination and - issuing the TERM signal. Selecting a container - instance for termination begins an asynchronous drain - of new requests on upstream load-balancers. (Default - 15). - "grace_period_seconds": 0 # Optional. The number of - seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate - shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "catchall_document": "str", - # Optional. The name of the document to use as the - fallback for any requests to documents that are not found - when serving this static site. Only 1 of - ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ] + }, + "active_deployment": { + "cause": "str", # Optional. What caused this + deployment to be created. + "cloned_from": "str", # Optional. The ID of a + previous deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name + of this functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name + of this job. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # + Optional. When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of + unsuccessful steps. + "pending_steps": 0, # Optional. Number of + pending steps. + "running_steps": 0, # Optional. Number of + currently running steps. + "steps": [ + { + "component_name": "str", # + Optional. The component name that this step is associated + with. + "ended_at": "2020-02-20 + 00:00:00", # Optional. The end time of this step. + "message_base": "str", # + Optional. The base of a human-readable description of the + step intended to be combined with the component name for + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". + "name": "str", # Optional. + The name of this step. + "reason": { + "code": "str", # + Optional. The error code. + "message": "str" # + Optional. The error message. + }, + "started_at": "2020-02-20 + 00:00:00", # Optional. The start time of this step. + "status": "UNKNOWN", # + Optional. Default value is "UNKNOWN". Known values are: + "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child + steps of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of + successful steps. + "summary_steps": [ + { + "component_name": "str", # + Optional. The component name that this step is associated + with. + "ended_at": "2020-02-20 + 00:00:00", # Optional. The end time of this step. + "message_base": "str", # + Optional. The base of a human-readable description of the + step intended to be combined with the component name for + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". + "name": "str", # Optional. + The name of this step. + "reason": { + "code": "str", # + Optional. The error code. + "message": "str" # + Optional. The error message. + }, + "started_at": "2020-02-20 + 00:00:00", # Optional. The start time of this step. + "status": "UNKNOWN", # + Optional. Default value is "UNKNOWN". Known values are: + "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child + steps of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of + steps. + }, + "services": [ + { + "name": "str", # Optional. The name + of this service. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must + be unique across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. + "cluster_name": "str", # + Optional. The name of the underlying DigitalOcean DBaaS + cluster. This is required for production databases. For + dev databases, if cluster_name is not set, a new cluster + will be provisioned. + "db_name": "str", # + Optional. The name of the MySQL or PostgreSQL database to + configure. + "db_user": "str", # + Optional. The name of the MySQL or PostgreSQL user to + configure. + "engine": "UNSET", # + Optional. Default value is "UNSET". * MYSQL: MySQL * PG: + PostgreSQL * REDIS: Redis. Known values are: "UNSET", + "MYSQL", "PG", and "REDIS". + "production": bool, # + Optional. Whether this is a production or dev database. + "version": "str" # Optional. + The version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The + hostname for the domain. Required. + "minimum_tls_version": "str", + # Optional. The minimum version of TLS a client + application can use to access resources for the domain. + Must be one of the following values wrapped within + quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # + Optional. Default value is "UNSPECIFIED". * DEFAULT: The + default ``.ondigitalocean.app`` domain assigned to this + app * PRIMARY: The primary domain for this app that is + displayed as the default in the control panel, used in + bindable environment variables, and any other places that + reference an app's live URL. Only one domain may be set + as primary. * ALIAS: A non-primary domain. Known values + are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # + Optional. Indicates whether the domain includes all + sub-domains, in addition to the given domain. + "zone": "str" # Optional. + Optional. If the domain uses DigitalOcean DNS and you + would like App Platform to automatically manage it for + you, set this to the name of the domain on your account. + For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. + Default value is "AUTOASSIGN". The app egress type. Known + values are: "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. + "alerts": [ + { + "disabled": + bool, # Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default + value is "UNSPECIFIED_OPERATOR". Known values + are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, + # Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value + is "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", + "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], "allow_methods": [ "str" # Optional. The set of allowed HTTP methods. This @@ -2883,16 +3438,6 @@ async def list( request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. "envs": [ { "key": "str", @@ -2900,8 +3445,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -2909,9 +3454,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -2919,11 +3464,6 @@ async def list( encrypted value should be used. } ], - "error_document": "404.html", - # Optional. Default value is "404.html". The name of the - error document to use when serving this static site. - Default: 404.html. If no such file exists within the - built assets, App Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -2952,46 +3492,9 @@ async def list( Optional. The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. - }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. - }, - "index_document": - "index.html", # Optional. Default value is "index.html". - The name of the index document to use when serving this - static site. Default: index.html. "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -3022,20 +3525,28 @@ async def list( index name to use for the logs. If not set, the default index name is "logs". }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, "papertrail": { "endpoint": "str" # Papertrail syslog endpoint. Required. } }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "output_dir": "str", # - Optional. An optional path to where the built assets will - be located, relative to the build context. If not set, - App Platform will automatically scan for these directory - names: ``_static``"" , ``dist``"" , ``public``"" , - ``build``. "routes": [ { "path": @@ -3054,9 +3565,6 @@ async def list( ``/api/list``. } ], - "run_command": "str", # - Optional. An optional run command to override the - component's default. "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be @@ -3064,45 +3572,157 @@ async def list( of the repo. } ], - "workers": [ - { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } + "ingress": { + "rules": [ + { + "component": { + "name": + "str", # The name of the component to route to. + Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive + with ``rewrite``. + "rewrite": + "str" # Optional. An optional field that will + rewrite the path of the component to be what is + specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If you specified the + rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + "cors": { + "allow_credentials": bool, # Optional. Whether + browsers should expose the response to the + client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" + # Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" + # Optional. The set of allowed HTTP methods. + This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" + , ``prefix``"" , or ``regex`` must be + set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" + , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 + syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" + # Optional. The set of HTTP response headers + that browsers are allowed to access. This + configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": + "str" # Optional. An optional duration + specifying how long browsers can cache the + results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # Prefix-based match. For + example, ``/api`` will match ``/api``"" , + ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": + "str", # Optional. The authority/host to + redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, # Optional. The redirect + code to use. Defaults to ``302``. Supported + values are 300, 301, 302, 303, 304, 307, 308. + "scheme": + "str", # Optional. The scheme to redirect to. + Supported values are ``http`` or ``https``. + Default: ``https``. + "uri": "str" + # Optional. An optional URI path to redirect to. + Note: if this is specified the whole URI of the + original request will be overwritten to this + value, irrespective of the original request URI + being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": + 0, # Optional. The maximum amount of instances for + this component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. Default value is + 80. The average target CPU utilization for + the component. + } + }, + "min_instance_count": + 0 # Optional. The minimum amount of instances for + this component. Must be less than max_instance_count. + }, + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { "key": "str", # The variable name. Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -3110,9 +3730,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -3165,16 +3785,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -3198,7 +3818,18 @@ async def list( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # + Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: + Default job type, will auto-complete to POST_DEPLOY kind. + * PRE_DEPLOY: Indicates a job that runs before an app + deployment. * POST_DEPLOY: Indicates a job that runs + after an app deployment. * FAILED_DEPLOY: Indicates a job + that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -3210,9 +3841,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -3220,10 +3853,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -3252,314 +3881,31 @@ async def list( shutdown. (Default 120). } } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name - of this static site. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this static site. - } - ], - "tier_slug": "str", # Optional. The current pricing - tier slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name - of this worker. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this worker. - } - ] - }, - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the - dedicated egress IP. - "ip": "str", # Optional. The IP address of - the dedicated egress IP. - "status": "UNKNOWN" # Optional. Default - value is "UNKNOWN". The status of the dedicated egress IP. Known - values are: "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname - on which the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 - 00:00:00", # Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the - domain. - "phase": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "CONFIGURING", "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of - the domain's progress. - ] - }, - "rotate_validation_records": bool, # - Optional. Validation values have changed and require manual - intervention. - "spec": { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # - Optional. TXT record name. - "txt_value": "str" # - Optional. TXT record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { - "cause": "str", # Optional. What caused this - deployment to be created. - "cloned_from": "str", # Optional. The ID of a - previous deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name - of this functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name - of this job. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # - Optional. When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of - unsuccessful steps. - "pending_steps": 0, # Optional. Number of - pending steps. - "running_steps": 0, # Optional. Number of - currently running steps. - "steps": [ - { - "component_name": "str", # - Optional. The component name that this step is associated - with. - "ended_at": "2020-02-20 - 00:00:00", # Optional. The end time of this step. - "message_base": "str", # - Optional. The base of a human-readable description of the - step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". - "name": "str", # Optional. - The name of this step. - "reason": { - "code": "str", # - Optional. The error code. - "message": "str" # - Optional. The error message. - }, - "started_at": "2020-02-20 - 00:00:00", # Optional. The start time of this step. - "status": "UNKNOWN", # - Optional. Default value is "UNKNOWN". Known values are: - "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child - steps of this step. - ] - } ], - "success_steps": 0, # Optional. Number of - successful steps. - "summary_steps": [ + "region": "str", # Optional. The slug form + of the geographical origin of the app. Default: ``nearest + available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", + "blr", "tor", "lon", and "syd". + "services": [ { - "component_name": "str", # - Optional. The component name that this step is associated - with. - "ended_at": "2020-02-20 - 00:00:00", # Optional. The end time of this step. - "message_base": "str", # - Optional. The base of a human-readable description of the - step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". - "name": "str", # Optional. - The name of this step. - "reason": { - "code": "str", # - Optional. The error code. - "message": "str" # - Optional. The error message. + "autoscaling": { + "max_instance_count": + 0, # Optional. The maximum amount of instances for + this component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. Default value is + 80. The average target CPU utilization for + the component. + } + }, + "min_instance_count": + 0 # Optional. The minimum amount of instances for + this component. Must be less than max_instance_count. }, - "started_at": "2020-02-20 - 00:00:00", # Optional. The start time of this step. - "status": "UNKNOWN", # - Optional. Default value is "UNKNOWN". Known values are: - "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child - steps of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of - steps. - }, - "services": [ - { - "name": "str", # Optional. The name - of this service. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # - Optional. The name of the underlying DigitalOcean DBaaS - cluster. This is required for production databases. For - dev databases, if cluster_name is not set, a new cluster - will be provisioned. - "db_name": "str", # - Optional. The name of the MySQL or PostgreSQL database to - configure. - "db_user": "str", # - Optional. The name of the MySQL or PostgreSQL user to - configure. - "engine": "UNSET", # - Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG: - PostgreSQL"n* REDIS: Redis. Known values are: "UNSET", - "MYSQL", "PG", and "REDIS". - "name": "str", # The name. - Must be unique across all components within the same app. - Required. - "production": bool, # - Optional. Whether this is a production or dev database. - "version": "str" # Optional. - The version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The - hostname for the domain. Required. - "minimum_tls_version": "str", - # Optional. The minimum version of TLS a client - application can use to access resources for the domain. - Must be one of the following values wrapped within - quotations: ``"1.2"`` or ``"1.3"``. Known values are: - "1.2" and "1.3". - "type": "UNSPECIFIED", # - Optional. Default value is "UNSPECIFIED". * DEFAULT: The - default ``.ondigitalocean.app`` domain assigned to this - app"n* PRIMARY: The primary domain for this app that is - displayed as the default in the control panel, used in - bindable environment variables, and any other places that - reference an app's live URL. Only one domain may be set - as primary."n* ALIAS: A non-primary domain. Known values - are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # - Optional. Indicates whether the domain includes all - sub-domains, in addition to the given domain. - "zone": "str" # Optional. - Optional. If the domain uses DigitalOcean DNS and you - would like App"nPlatform to automatically manage it for - you, set this to the name of the"ndomain on your - account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. - Default value is "AUTOASSIGN". The app egress type. Known - values are: "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": - bool, # Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default - value is "UNSPECIFIED_OPERATOR". Known values - are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, - # Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value - is "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", - "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR". - } - ], + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the @@ -3606,6 +3952,16 @@ async def list( request. This configures the ``Access-Control-Max-Age`` header. }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. "envs": [ { "key": "str", @@ -3613,8 +3969,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -3622,9 +3978,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -3660,545 +4016,35 @@ async def list( Optional. The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". - }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. - Must be unique across all components within the same app. - Required. - "routes": [ - { - "path": - "str", # Optional. (Deprecated - Use Ingress - Rules instead). An HTTP path prefix. Paths must - start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "source_dir": "str" # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": - "str", # The name of the component to route to. - Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive - with ``rewrite``. - "rewrite": - "str" # Optional. An optional field that will - rewrite the path of the component to be what is - specified here. By default, the HTTP request path - will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If you specified the - rewrite to be ``/v1/``"" , requests to - ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": bool, # Optional. Whether - browsers should expose the response to the - client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" - # Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" - # Optional. The set of allowed HTTP methods. - This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" - , ``prefix``"" , or ``regex`` must be - set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" - , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 - syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" - # Optional. The set of HTTP response headers - that browsers are allowed to access. This - configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": - "str" # Optional. An optional duration - specifying how long browsers can cache the - results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": "str" # Prefix-based match. For - example, ``/api`` will match ``/api``"" , - ``/api/``"" , and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": - "str", # Optional. The authority/host to - redirect to. This can be a hostname or IP - address. Note: use ``port`` to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, # Optional. The redirect - code to use. Defaults to ``302``. Supported - values are 300, 301, 302, 303, 304, 307, 308. - "scheme": - "str", # Optional. The scheme to redirect to. - Supported values are ``http`` or ``https``. - Default: ``https``. - "uri": "str" - # Optional. An optional URI path to redirect to. - Note: if this is specified the whole URI of the - original request will be overwritten to this - value, irrespective of the original request URI - being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. - }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. - }, - "instance_count": 1, # - Optional. Default value is 1. The amount of instances - that this component should be scaled to. Default: 1. Must - not be set if autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", - "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", - "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", - "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", - "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # - Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: - Default job type, will auto-complete to POST_DEPLOY - kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs - after an app deployment."n* FAILED_DEPLOY: Indicates a - job that runs after a component fails to deploy. Known - values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", - and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". - }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "run_command": "str", # - Optional. An optional run command to override the - component's default. - "source_dir": "str", # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The number of - seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate - shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must - be unique across all apps in the same account. Required. - "region": "str", # Optional. The slug form - of the geographical origin of the app. Default: ``nearest - available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", - "blr", "tor", "lon", and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": - 0, # Optional. The number of failed health checks - before considered unhealthy. - "http_path": "str", - # Optional. The route path used for the HTTP health - check ping. If not set, the HTTP health check will be - disabled and a TCP health check used instead. - "initial_delay_seconds": 0, # Optional. The number - of seconds to wait before beginning health checks. - "period_seconds": 0, - # Optional. The number of seconds to wait between - health checks. - "port": 0, # - Optional. The port on which the health check will be - performed. If not set, the health check will be - performed on the component's http_port. - "success_threshold": - 0, # Optional. The number of successful health - checks before considered healthy. - "timeout_seconds": 0 - # Optional. The number of seconds after which the - check times out. + "health_check": { + "failure_threshold": + 0, # Optional. The number of failed health checks + before considered unhealthy. + "http_path": "str", + # Optional. The route path used for the HTTP health + check ping. If not set, the HTTP health check will be + disabled and a TCP health check used instead. + "initial_delay_seconds": 0, # Optional. The number + of seconds to wait before beginning health checks. + "period_seconds": 0, + # Optional. The number of seconds to wait between + health checks. + "port": 0, # + Optional. The port on which the health check will be + performed. If not set, the health check will be + performed on the component's http_port. + "success_threshold": + 0, # Optional. The number of successful health + checks before considered healthy. + "timeout_seconds": 0 + # Optional. The number of seconds after which the + check times out. }, "http_port": 0, # Optional. The internal port on which this service's run command - will listen. Default: 8080"nIf there is not an - environment variable with the name ``PORT``"" , one will - be automatically added with its value set to the value of + will listen. Default: 8080 If there is not an environment + variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. "image": { "deploy_on_push": { @@ -4217,16 +4063,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -4256,6 +4102,8 @@ async def list( traffic. ], "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -4267,9 +4115,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -4277,10 +4127,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -4408,8 +4254,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -4417,9 +4263,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -4477,16 +4323,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -4500,6 +4346,8 @@ async def list( The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -4511,9 +4359,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -4521,10 +4371,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -4609,8 +4455,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -4618,9 +4464,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -4673,16 +4519,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -4707,6 +4553,8 @@ async def list( "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -4718,9 +4566,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -4728,10 +4578,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -4785,19 +4631,81 @@ async def list( } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # - Optional. The creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the - app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the - app, the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to - which the application belongs. - "pending_deployment": { - "cause": "str", # Optional. What caused this - deployment to be created. - "cloned_from": "str", # Optional. The ID of a + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the + dedicated egress IP. + "ip": "str", # Optional. The IP address of + the dedicated egress IP. + "status": "UNKNOWN" # Optional. Default + value is "UNKNOWN". The status of the dedicated egress IP. Known + values are: "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname + on which the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 + 00:00:00", # Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the + domain. + "phase": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "CONFIGURING", "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of + the domain's progress. + ] + }, + "rotate_validation_records": bool, # + Optional. Validation values have changed and require manual + intervention. + "spec": { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # + Optional. TXT record name. + "txt_value": "str" # + Optional. TXT record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { + "cause": "str", # Optional. What caused this + deployment to be created. + "cloned_from": "str", # Optional. The ID of a previous deployment that this deployment was cloned from. "created_at": "2020-02-20 00:00:00", # Optional. The creation time of the deployment. @@ -4845,8 +4753,8 @@ async def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -4878,8 +4786,8 @@ async def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -4912,8 +4820,13 @@ async def list( } ], "spec": { + "name": "str", # The name of the app. Must + be unique across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For @@ -4926,12 +4839,9 @@ async def list( Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # - Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG: - PostgreSQL"n* REDIS: Redis. Known values are: "UNSET", + Optional. Default value is "UNSET". * MYSQL: MySQL * PG: + PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. @@ -4951,21 +4861,21 @@ async def list( "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain assigned to this - app"n* PRIMARY: The primary domain for this app that is + app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set - as primary."n* ALIAS: A non-primary domain. Known values + as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain uses DigitalOcean DNS and you - would like App"nPlatform to automatically manage it for - you, set this to the name of the"ndomain on your - account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + would like App Platform to automatically manage it for + you, set this to the name of the domain on your account. + For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -4975,6 +4885,9 @@ async def list( }, "functions": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "alerts": [ { "disabled": @@ -5059,8 +4972,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -5068,9 +4981,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -5107,6 +5020,8 @@ async def list( owner/repo. Example: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -5118,9 +5033,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -5128,10 +5045,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -5142,9 +5055,6 @@ async def list( "str" # Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "routes": [ { "path": @@ -5319,8 +5229,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -5328,9 +5238,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -5383,16 +5293,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -5418,14 +5328,16 @@ async def list( "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: - Default job type, will auto-complete to POST_DEPLOY - kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs - after an app deployment."n* FAILED_DEPLOY: Indicates a - job that runs after a component fails to deploy. Known - values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", - and "FAILED_DEPLOY". + Default job type, will auto-complete to POST_DEPLOY kind. + * PRE_DEPLOY: Indicates a job that runs before an app + deployment. * POST_DEPLOY: Indicates a job that runs + after an app deployment. * FAILED_DEPLOY: Indicates a job + that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -5437,9 +5349,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -5447,10 +5361,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -5480,8 +5390,6 @@ async def list( } } ], - "name": "str", # The name of the app. Must - be unique across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", @@ -5569,8 +5477,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -5578,9 +5486,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -5642,9 +5550,9 @@ async def list( }, "http_port": 0, # Optional. The internal port on which this service's run command - will listen. Default: 8080"nIf there is not an - environment variable with the name ``PORT``"" , one will - be automatically added with its value set to the value of + will listen. Default: 8080 If there is not an environment + variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. "image": { "deploy_on_push": { @@ -5663,16 +5571,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -5702,6 +5610,8 @@ async def list( traffic. ], "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -5713,253 +5623,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, "endpoint": "str", # OpenSearch API Endpoint. Only HTTPS is supported. Format: :code:``::code:``. Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". - }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "routes": [ - { - "path": - "str", # Optional. (Deprecated - Use Ingress - Rules instead). An HTTP path prefix. Paths must - start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "run_command": "str", # - Optional. An optional run command to override the - component's default. - "source_dir": "str", # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - "termination": { - "drain_seconds": 0, - # Optional. The number of seconds to wait between - selecting a container instance for termination and - issuing the TERM signal. Selecting a container - instance for termination begins an asynchronous drain - of new requests on upstream load-balancers. (Default - 15). - "grace_period_seconds": 0 # Optional. The number of - seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate - shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "catchall_document": "str", - # Optional. The name of the document to use as the - fallback for any requests to documents that are not found - when serving this static site. Only 1 of - ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. - } - ], - "error_document": "404.html", - # Optional. Default value is "404.html". The name of the - error document to use when serving this static site. - Default: 404.html. If no such file exists within the - built assets, App Platform will supply one. - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. - }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. - }, - "index_document": - "index.html", # Optional. Default value is "index.html". - The name of the index document to use when serving this - static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { "basic_auth": { "password": "str", # Password for user @@ -5967,10 +5635,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -5984,12 +5648,256 @@ async def list( "name": "str", # Optional. The name. Must be unique across all components within the same app. - "output_dir": "str", # - Optional. An optional path to where the built assets will - be located, relative to the build context. If not set, - App Platform will automatically scan for these directory - names: ``_static``"" , ``dist``"" , ``public``"" , - ``build``. + "routes": [ + { + "path": + "str", # Optional. (Deprecated - Use Ingress + Rules instead). An HTTP path prefix. Paths must + start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str", # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, + # Optional. The number of seconds to wait between + selecting a container instance for termination and + issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain + of new requests on upstream load-balancers. (Default + 15). + "grace_period_seconds": 0 # Optional. The number of + seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate + shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. + "catchall_document": "str", + # Optional. The name of the document to use as the + fallback for any requests to documents that are not found + when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. + } + ], + "error_document": "404.html", + # Optional. Default value is "404.html". The name of the + error document to use when serving this static site. + Default: 404.html. If no such file exists within the + built assets, App Platform will supply one. + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. + }, + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. + }, + "index_document": + "index.html", # Optional. Default value is "index.html". + The name of the index document to use when serving this + static site. Default: index.html. + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. + }, + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "output_dir": "str", # + Optional. An optional path to where the built assets will + be located, relative to the build context. If not set, + App Platform will automatically scan for these directory + names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. "routes": [ { "path": @@ -6055,8 +5963,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -6064,9 +5972,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -6119,16 +6027,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -6153,6 +6061,8 @@ async def list( "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -6164,9 +6074,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -6174,10 +6086,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -6231,7 +6139,16 @@ async def list( } ] }, - "pinned_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # + Optional. The creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the + app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the + app, the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to + which the application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a @@ -6282,8 +6199,8 @@ async def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -6315,8 +6232,8 @@ async def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -6349,8 +6266,13 @@ async def list( } ], "spec": { + "name": "str", # The name of the app. Must + be unique across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For @@ -6363,12 +6285,9 @@ async def list( Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # - Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG: - PostgreSQL"n* REDIS: Redis. Known values are: "UNSET", + Optional. Default value is "UNSET". * MYSQL: MySQL * PG: + PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. @@ -6388,21 +6307,21 @@ async def list( "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain assigned to this - app"n* PRIMARY: The primary domain for this app that is + app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set - as primary."n* ALIAS: A non-primary domain. Known values + as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain uses DigitalOcean DNS and you - would like App"nPlatform to automatically manage it for - you, set this to the name of the"ndomain on your - account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + would like App Platform to automatically manage it for + you, set this to the name of the domain on your account. + For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -6412,6 +6331,9 @@ async def list( }, "functions": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "alerts": [ { "disabled": @@ -6496,8 +6418,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -6505,9 +6427,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -6544,6 +6466,8 @@ async def list( owner/repo. Example: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -6555,9 +6479,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -6565,10 +6491,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -6579,9 +6501,6 @@ async def list( "str" # Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "routes": [ { "path": @@ -6756,8 +6675,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -6765,9 +6684,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -6820,16 +6739,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -6855,14 +6774,16 @@ async def list( "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: - Default job type, will auto-complete to POST_DEPLOY - kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs - after an app deployment."n* FAILED_DEPLOY: Indicates a - job that runs after a component fails to deploy. Known - values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", - and "FAILED_DEPLOY". + Default job type, will auto-complete to POST_DEPLOY kind. + * PRE_DEPLOY: Indicates a job that runs before an app + deployment. * POST_DEPLOY: Indicates a job that runs + after an app deployment. * FAILED_DEPLOY: Indicates a job + that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -6874,9 +6795,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -6884,10 +6807,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -6917,8 +6836,6 @@ async def list( } } ], - "name": "str", # The name of the app. Must - be unique across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", @@ -7006,8 +6923,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -7015,9 +6932,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -7079,9 +6996,9 @@ async def list( }, "http_port": 0, # Optional. The internal port on which this service's run command - will listen. Default: 8080"nIf there is not an - environment variable with the name ``PORT``"" , one will - be automatically added with its value set to the value of + will listen. Default: 8080 If there is not an environment + variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. "image": { "deploy_on_push": { @@ -7100,16 +7017,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -7139,6 +7056,8 @@ async def list( traffic. ], "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -7150,9 +7069,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -7160,10 +7081,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -7291,8 +7208,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -7300,9 +7217,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -7360,16 +7277,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -7383,6 +7300,8 @@ async def list( The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -7394,9 +7313,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -7404,10 +7325,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -7492,8 +7409,8 @@ async def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -7501,9 +7418,9 @@ async def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -7556,16 +7473,16 @@ async def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -7590,6 +7507,8 @@ async def list( "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -7601,9 +7520,11 @@ async def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -7611,10 +7532,6 @@ async def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -7668,299 +7585,718 @@ async def list( } ] }, - "project_id": "str", # Optional. The ID of the project the - app is assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that - this region is in. - "data_centers": [ - "str" # Optional. Data centers that are in - this region. - ], - "default": bool, # Optional. Whether or not the - region is presented as the default. - "disabled": bool, # Optional. Whether or not the - region is open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of - the region. - "reason": "str", # Optional. Reason that this region - is not available. - "slug": "str" # Optional. The slug form of the - region name. - }, - "spec": { - "databases": [ + "pinned_deployment": { + "cause": "str", # Optional. What caused this + deployment to be created. + "cloned_from": "str", # Optional. The ID of a + previous deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. + "name": "str", # Optional. The name + of this functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this functions component. } ], - "domains": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + "name": "str", # Optional. The name + of this job. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this job. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # + Optional. When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of + unsuccessful steps. + "pending_steps": 0, # Optional. Number of + pending steps. + "running_steps": 0, # Optional. Number of + currently running steps. + "steps": [ + { + "component_name": "str", # + Optional. The component name that this step is associated + with. + "ended_at": "2020-02-20 + 00:00:00", # Optional. The end time of this step. + "message_base": "str", # + Optional. The base of a human-readable description of the + step intended to be combined with the component name for + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". + "name": "str", # Optional. + The name of this step. + "reason": { + "code": "str", # + Optional. The error code. + "message": "str" # + Optional. The error message. + }, + "started_at": "2020-02-20 + 00:00:00", # Optional. The start time of this step. + "status": "UNKNOWN", # + Optional. Default value is "UNKNOWN". Known values are: + "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child + steps of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of + successful steps. + "summary_steps": [ + { + "component_name": "str", # + Optional. The component name that this step is associated + with. + "ended_at": "2020-02-20 + 00:00:00", # Optional. The end time of this step. + "message_base": "str", # + Optional. The base of a human-readable description of the + step intended to be combined with the component name for + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". + "name": "str", # Optional. + The name of this step. + "reason": { + "code": "str", # + Optional. The error code. + "message": "str" # + Optional. The error message. + }, + "started_at": "2020-02-20 + 00:00:00", # Optional. The start time of this step. + "status": "UNKNOWN", # + Optional. Default value is "UNKNOWN". Known values are: + "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child + steps of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of + steps. }, - "functions": [ + "services": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "name": "str", # Optional. The name + of this service. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must + be unique across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. + "cluster_name": "str", # + Optional. The name of the underlying DigitalOcean DBaaS + cluster. This is required for production databases. For + dev databases, if cluster_name is not set, a new cluster + will be provisioned. + "db_name": "str", # + Optional. The name of the MySQL or PostgreSQL database to + configure. + "db_user": "str", # + Optional. The name of the MySQL or PostgreSQL user to + configure. + "engine": "UNSET", # + Optional. Default value is "UNSET". * MYSQL: MySQL * PG: + PostgreSQL * REDIS: Redis. Known values are: "UNSET", + "MYSQL", "PG", and "REDIS". + "production": bool, # + Optional. Whether this is a production or dev database. + "version": "str" # Optional. + The version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The + hostname for the domain. Required. + "minimum_tls_version": "str", + # Optional. The minimum version of TLS a client + application can use to access resources for the domain. + Must be one of the following values wrapped within + quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # + Optional. Default value is "UNSPECIFIED". * DEFAULT: The + default ``.ondigitalocean.app`` domain assigned to this + app * PRIMARY: The primary domain for this app that is + displayed as the default in the control panel, used in + bindable environment variables, and any other places that + reference an app's live URL. Only one domain may be set + as primary. * ALIAS: A non-primary domain. Known values + are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # + Optional. Indicates whether the domain includes all + sub-domains, in addition to the given domain. + "zone": "str" # Optional. + Optional. If the domain uses DigitalOcean DNS and you + would like App Platform to automatically manage it for + you, set this to the name of the domain on your account. + For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. + Default value is "AUTOASSIGN". The app egress type. Known + values are: "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. + "alerts": [ { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "disabled": + bool, # Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default + value is "UNSPECIFIED_OPERATOR". Known values + are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, + # Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value + is "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", + "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR". } ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. }, - "logtail": { - "token": "str" # - Optional. Logtail token. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ + "routes": [ + { + "path": + "str", # Optional. (Deprecated - Use Ingress + Rules instead). An HTTP path prefix. Paths must + start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "source_dir": "str" # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "component": { + "name": + "str", # The name of the component to route to. + Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive + with ``rewrite``. + "rewrite": + "str" # Optional. An optional field that will + rewrite the path of the component to be what is + specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If you specified the + rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # Optional. Whether + browsers should expose the response to the + client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" + # Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" + # Optional. The set of allowed HTTP methods. + This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" + , ``prefix``"" , or ``regex`` must be + set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" + , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 + syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" + # Optional. The set of HTTP response headers + that browsers are allowed to access. This + configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": + "str" # Optional. An optional duration + specifying how long browsers can cache the + results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # Prefix-based match. For + example, ``/api`` will match ``/api``"" , + ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": + "str", # Optional. The authority/host to + redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, # Optional. The redirect + code to use. Defaults to ``302``. Supported + values are 300, 301, 302, 303, 304, 307, 308. + "scheme": + "str", # Optional. The scheme to redirect to. + Supported values are ``http`` or ``https``. + Default: ``https``. + "uri": "str" + # Optional. An optional URI path to redirect to. + Note: if this is specified the whole URI of the + original request will be overwritten to this + value, irrespective of the original request URI + being matched. + } } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + ] + }, + "jobs": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. + "autoscaling": { + "max_instance_count": + 0, # Optional. The maximum amount of instances for + this component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. Default value is + 80. The average target CPU utilization for + the component. + } + }, + "min_instance_count": + 0 # Optional. The minimum amount of instances for + this component. Must be less than max_instance_count. + }, + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. + }, + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. + }, + "instance_count": 1, # + Optional. Default value is 1. The amount of instances + that this component should be scaled to. Default: 1. Must + not be set if autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", + "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", + "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", + "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", + "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # + Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: + Default job type, will auto-complete to POST_DEPLOY kind. + * PRE_DEPLOY: Indicates a job that runs before an app + deployment. * POST_DEPLOY: Indicates a job that runs + after an app deployment. * FAILED_DEPLOY: Indicates a job + that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. + }, + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str", # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The number of + seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate + shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form + of the geographical origin of the app. Default: ``nearest + available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", + "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": + 0, # Optional. The maximum amount of instances for + this component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. Default value is + 80. The average target CPU utilization for + the component. + } + }, + "min_instance_count": + 0 # Optional. The minimum amount of instances for + this component. Must be less than max_instance_count. }, + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the @@ -8007,910 +8343,706 @@ async def list( request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. } + ], + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "health_check": { + "failure_threshold": + 0, # Optional. The number of failed health checks + before considered unhealthy. + "http_path": "str", + # Optional. The route path used for the HTTP health + check ping. If not set, the HTTP health check will be + disabled and a TCP health check used instead. + "initial_delay_seconds": 0, # Optional. The number + of seconds to wait before beginning health checks. + "period_seconds": 0, + # Optional. The number of seconds to wait between + health checks. + "port": 0, # + Optional. The port on which the health check will be + performed. If not set, the health check will be + performed on the component's http_port. + "success_threshold": + 0, # Optional. The number of successful health + checks before considered healthy. + "timeout_seconds": 0 + # Optional. The number of seconds after which the + check times out. }, - "logtail": { - "token": "str" # - Optional. Logtail token. + "http_port": 0, # Optional. + The internal port on which this service's run command + will listen. Default: 8080 If there is not an environment + variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of + this field. + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. + }, + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. + "instance_count": 1, # + Optional. Default value is 1. The amount of instances + that this component should be scaled to. Default: 1. Must + not be set if autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", + "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", + "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", + "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", + "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The + ports on which this service will listen for internal + traffic. + ], + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "routes": [ + { + "path": + "str", # Optional. (Deprecated - Use Ingress + Rules instead). An HTTP path prefix. Paths must + start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str", # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, + # Optional. The number of seconds to wait between + selecting a container instance for termination and + issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain + of new requests on upstream load-balancers. (Default + 15). + "grace_period_seconds": 0 # Optional. The number of + seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate + shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` + ], + "static_sites": [ + { + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. + "catchall_document": "str", + # Optional. The name of the document to use as the + fallback for any requests to documents that are not found + when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. } ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "error_document": "404.html", + # Optional. Default value is "404.html". The name of the + error document to use when serving this static site. + Default: 404.html. If no such file exists within the + built assets, App Platform will supply one. + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # - Optional. Logtail token. + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "index_document": + "index.html", # Optional. Default value is "index.html". + The name of the index document to use when serving this + static site. Default: index.html. + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. + }, + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "output_dir": "str", # + Optional. An optional path to where the built assets will + be located, relative to the build context. If not set, + App Platform will automatically scan for these directory + names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": + "str", # Optional. (Deprecated - Use Ingress + Rules instead). An HTTP path prefix. Paths must + start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str" # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": + 0, # Optional. The maximum amount of instances for + this component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. Default value is + 80. The average target CPU utilization for + the component. + } }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "min_instance_count": + 0 # Optional. The minimum amount of instances for + this component. Must be less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. } + ], + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # - Optional. Logtail token. + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. + }, + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. + "instance_count": 1, # + Optional. Default value is 1. The amount of instances + that this component should be scaled to. Default: 1. Must + not be set if autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", + "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", + "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", + "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", + "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str", # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The number of + seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate + shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name + of this static site. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this static site. + } + ], + "tier_slug": "str", # Optional. The current pricing + tier slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name + of this worker. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this worker. } ] }, + "project_id": "str", # Optional. The ID of the project the + app is assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that + this region is in. + "data_centers": [ + "str" # Optional. Data centers that are in + this region. + ], + "default": bool, # Optional. Whether or not the + region is presented as the default. + "disabled": bool, # Optional. Whether or not the + region is open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of + the region. + "reason": "str", # Optional. Reason that this region + is not available. + "slug": "str" # Optional. The slug form of the + region name. + }, "tier_slug": "str", # Optional. The current pricing tier slug of the app. "updated_at": "2020-02-20 00:00:00" # Optional. Time of the @@ -8919,16 +9051,17 @@ async def list( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -8937,27 +9070,30 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_list_request( + _request = build_apps_list_request( page=page, per_page=per_page, with_projects=with_projects, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -8977,18 +9113,19 @@ async def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New App. - Create a new app by submitting an app specification. For documentation on app specifications (\ - ``AppSpec`` objects), please refer to `the product documentation + Create a new app by submitting an app specification. For documentation on app specifications + (\\ ``AppSpec`` objects), please refer to `the product documentation `_. :param body: Required. @@ -9005,11 +9142,13 @@ async def create( # JSON input template you can fill out and use as your body input. body = { - "project_id": "str", # Optional. The ID of the project the app should be - assigned to. If omitted, it will be assigned to your default project. "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, @@ -9019,10 +9158,8 @@ async def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of the @@ -9040,19 +9177,19 @@ async def create( "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that + assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A + live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -9062,6 +9199,8 @@ async def create( }, "functions": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "alerts": [ { "disabled": bool, # Optional. Is the @@ -9135,15 +9274,14 @@ async def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -9176,6 +9314,7 @@ async def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -9186,18 +9325,17 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -9207,8 +9345,6 @@ async def create( syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -9360,15 +9496,14 @@ async def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -9414,12 +9549,12 @@ async def create( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -9442,12 +9577,13 @@ async def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -9458,18 +9594,17 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -9495,8 +9630,6 @@ async def create( } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -9574,15 +9707,14 @@ async def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -9634,7 +9766,7 @@ async def create( of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -9651,12 +9783,12 @@ async def create( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -9682,6 +9814,7 @@ async def create( service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -9692,18 +9825,17 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -9813,15 +9945,14 @@ async def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -9871,12 +10002,12 @@ async def create( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -9890,6 +10021,7 @@ async def create( value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -9900,18 +10032,17 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -9985,15 +10116,14 @@ async def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -10039,12 +10169,12 @@ async def create( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -10066,6 +10196,7 @@ async def create( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -10076,18 +10207,17 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -10113,215 +10243,275 @@ async def create( } } ] - } + }, + "project_id": "str" # Optional. The ID of the project the app should be + assigned to. If omitted, it will be assigned to your default project. } # response body for status code(s): 200 response == { "app": { - "active_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "domains": [ { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. } ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". }, - "services": [ + "functions": [ { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -10368,1184 +10558,852 @@ async def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { + "active_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -11594,8 +11452,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -11626,8 +11484,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -11659,8 +11517,12 @@ async def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -11670,11 +11532,9 @@ async def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -11692,22 +11552,22 @@ async def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -11717,6 +11577,8 @@ async def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -11801,13 +11663,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -11845,6 +11707,7 @@ async def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -11855,8 +11718,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -11864,10 +11730,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -11878,8 +11740,6 @@ async def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -12046,13 +11906,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -12106,15 +11966,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -12138,13 +11998,14 @@ async def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -12155,8 +12016,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -12164,10 +12028,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -12194,8 +12054,6 @@ async def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -12283,13 +12141,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -12353,9 +12211,9 @@ async def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -12373,15 +12231,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -12408,6 +12266,7 @@ async def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -12418,8 +12277,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -12427,10 +12289,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -12552,13 +12410,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -12617,15 +12475,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -12638,6 +12496,7 @@ async def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -12648,8 +12507,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -12657,10 +12519,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -12739,13 +12597,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -12799,15 +12657,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -12830,6 +12688,7 @@ async def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -12840,8 +12699,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -12849,10 +12711,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -12902,15 +12760,76 @@ async def create( } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -12959,8 +12878,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -12991,8 +12910,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -13024,8 +12943,12 @@ async def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -13035,11 +12958,9 @@ async def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -13057,22 +12978,22 @@ async def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -13082,6 +13003,8 @@ async def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -13166,13 +13089,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -13210,6 +13133,7 @@ async def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -13220,8 +13144,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -13229,10 +13156,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -13243,8 +13166,6 @@ async def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -13411,13 +13332,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -13471,15 +13392,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -13503,13 +13424,14 @@ async def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -13520,8 +13442,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -13529,10 +13454,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -13559,8 +13480,6 @@ async def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -13648,13 +13567,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -13718,9 +13637,9 @@ async def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -13738,15 +13657,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -13773,6 +13692,7 @@ async def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -13783,8 +13703,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -13792,10 +13715,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -13917,13 +13836,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -13982,15 +13901,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -14003,6 +13922,7 @@ async def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -14013,8 +13933,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -14022,10 +13945,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -14104,13 +14023,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -14164,15 +14083,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -14195,6 +14114,7 @@ async def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -14205,8 +14125,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -14214,10 +14137,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -14267,7 +14186,15 @@ async def create( } ] }, - "pinned_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -14316,8 +14243,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -14348,8 +14275,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -14381,8 +14308,12 @@ async def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -14392,11 +14323,9 @@ async def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -14414,22 +14343,22 @@ async def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -14439,6 +14368,8 @@ async def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -14523,13 +14454,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -14567,6 +14498,7 @@ async def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -14577,8 +14509,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -14586,10 +14521,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -14600,8 +14531,6 @@ async def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -14768,13 +14697,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -14828,15 +14757,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -14860,13 +14789,14 @@ async def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -14877,8 +14807,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -14886,10 +14819,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -14916,8 +14845,6 @@ async def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -15005,13 +14932,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -15075,9 +15002,9 @@ async def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -15095,15 +15022,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -15130,6 +15057,7 @@ async def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -15140,8 +15068,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -15149,10 +15080,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -15274,13 +15201,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -15339,15 +15266,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -15360,6 +15287,7 @@ async def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -15370,8 +15298,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -15379,10 +15310,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -15461,13 +15388,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -15521,15 +15448,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -15552,6 +15479,7 @@ async def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -15562,8 +15490,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -15571,10 +15502,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -15624,285 +15551,213 @@ async def create( } ] }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ + "pinned_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "domains": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. }, - "functions": [ + "services": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. } ], - "ingress": { - "rules": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -15949,1089 +15804,697 @@ async def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - """ - - @overload - async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Create a New App. - - Create a new app by submitting an app specification. For documentation on app specifications (\ - ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -17078,6 +16541,16 @@ async def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. "envs": [ { "key": "str", # The @@ -17085,13 +16558,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -17101,6 +16574,11 @@ async def create( used. } ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -17128,7 +16606,45 @@ async def create( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -17139,8 +16655,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -17148,10 +16667,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -17162,8 +16677,13 @@ async def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -17180,120 +16700,15 @@ async def create( the path will remain ``/api/list``. } ], + "run_command": "str", # Optional. An + optional run command to override the component's default. "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. } ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ + "workers": [ { "autoscaling": { "max_instance_count": 0, # @@ -17330,13 +16745,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -17390,15 +16805,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -17420,15 +16835,8 @@ async def create( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -17439,8 +16847,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -17448,10 +16859,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -17477,65 +16884,377 @@ async def create( causes immediate shutdown. (Default 120). } } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. + } + ] + }, + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + """ + + @overload + async def create( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a New App. + + Create a new app by submitting an app specification. For documentation on app specifications + (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: https://github.com/google/re2/wiki/Syntax. } ], @@ -17550,841 +17269,983 @@ async def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. } ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ + "static_sites": [ { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "active_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -18402,22 +18263,22 @@ async def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -18427,6 +18288,8 @@ async def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -18511,13 +18374,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -18555,6 +18418,7 @@ async def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -18565,8 +18429,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -18574,10 +18441,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -18588,8 +18451,6 @@ async def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -18756,13 +18617,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -18816,15 +18677,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -18848,13 +18709,14 @@ async def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -18865,8 +18727,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -18874,10 +18739,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -18904,8 +18765,6 @@ async def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -18993,13 +18852,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -19063,9 +18922,9 @@ async def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -19083,15 +18942,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -19118,6 +18977,7 @@ async def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -19128,8 +18988,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -19137,10 +19000,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -19262,13 +19121,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -19327,15 +19186,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -19348,6 +19207,7 @@ async def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -19358,8 +19218,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -19367,10 +19230,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -19449,13 +19308,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -19509,15 +19368,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -19540,6 +19399,7 @@ async def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -19550,8 +19410,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -19559,10 +19422,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -19612,15 +19471,76 @@ async def create( } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -19669,8 +19589,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -19701,8 +19621,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -19734,8 +19654,12 @@ async def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -19745,11 +19669,9 @@ async def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -19767,22 +19689,22 @@ async def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -19792,6 +19714,8 @@ async def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -19876,13 +19800,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -19920,6 +19844,7 @@ async def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -19930,8 +19855,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -19939,10 +19867,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -19953,8 +19877,6 @@ async def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -20121,13 +20043,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -20181,15 +20103,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -20213,13 +20135,14 @@ async def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -20230,8 +20153,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -20239,10 +20165,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -20269,8 +20191,6 @@ async def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -20358,13 +20278,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -20428,9 +20348,9 @@ async def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -20448,15 +20368,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -20483,6 +20403,7 @@ async def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -20493,8 +20414,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -20502,10 +20426,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -20627,13 +20547,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -20692,15 +20612,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -20713,6 +20633,7 @@ async def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -20723,8 +20644,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -20732,10 +20656,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -20814,13 +20734,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -20874,15 +20794,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -20905,6 +20825,7 @@ async def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -20915,8 +20836,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -20924,10 +20848,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -20977,7 +20897,15 @@ async def create( } ] }, - "pinned_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -21026,8 +20954,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -21058,8 +20986,8 @@ async def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -21091,8 +21019,12 @@ async def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -21102,11 +21034,9 @@ async def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -21124,22 +21054,22 @@ async def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -21149,6 +21079,8 @@ async def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -21233,13 +21165,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -21277,6 +21209,7 @@ async def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -21287,8 +21220,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -21296,10 +21232,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -21310,8 +21242,6 @@ async def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -21478,13 +21408,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -21538,15 +21468,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -21570,13 +21500,14 @@ async def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -21587,8 +21518,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -21596,10 +21530,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -21626,8 +21556,6 @@ async def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -21715,13 +21643,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -21785,9 +21713,9 @@ async def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -21805,15 +21733,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -21840,6 +21768,7 @@ async def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -21850,8 +21779,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -21859,10 +21791,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -21984,13 +21912,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -22049,15 +21977,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -22070,6 +21998,7 @@ async def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -22080,8 +22009,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -22089,10 +22021,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -22171,13 +22099,13 @@ async def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -22231,15 +22159,15 @@ async def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -22262,6 +22190,7 @@ async def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -22272,8 +22201,11 @@ async def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -22281,10 +22213,6 @@ async def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -22334,285 +22262,213 @@ async def create( } ] }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ + "pinned_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "domains": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. }, - "functions": [ + "services": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -22659,1559 +22515,428 @@ async def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - """ - - @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Create a New App. - - Create a new app by submitting an app specification. For documentation on app specifications (\ - ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] } ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -24275,13 +23000,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -24345,9 +23070,9 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -24365,15 +23090,15 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -24400,6 +23125,7 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -24410,8 +23136,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -24419,10 +23148,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -24544,13 +23269,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -24609,15 +23334,15 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -24630,6 +23355,7 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -24640,8 +23366,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -24649,10 +23378,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -24731,13 +23456,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -24791,15 +23516,15 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -24822,6 +23547,7 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -24832,8 +23558,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -24841,10 +23570,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -24894,2115 +23619,1424 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + """ + + @distributed_trace_async + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a New App. + + Create a new app by submitting an app specification. For documentation on app specifications + (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. } ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ + "domains": [ + { + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". } ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "domains": [ + }, + "routes": [ { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of the + component to route to. Required. + "preserve_path_prefix": "str", # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for Functions + Components and is mutually exclusive with ``rewrite``. + "rewrite": "str" # Optional. An + optional field that will rewrite the path of the component to + be what is specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with ``path=/api`` will + have requests to ``/api/list`` trimmed to ``/list``. If you + specified the rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. Note: this + is mutually exclusive with ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # Optional. The + authority/host to redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # Optional. The port to + redirect to. + "redirect_code": 0, # Optional. The + redirect code to use. Defaults to ``302``. Supported values + are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. The + scheme to redirect to. Supported values are ``http`` or + ``https``. Default: ``https``. + "uri": "str" # Optional. An optional + URI path to redirect to. Note: if this is specified the whole + URI of the original request will be overwritten to this + value, irrespective of the original request URI being + matched. } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. } - ] + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. }, - "jobs": [ + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a + component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the geographical + origin of the app. Default: ``nearest available``. Known values are: "ams", + "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. The + number of failed health checks before considered unhealthy. + "http_path": "str", # Optional. The route + path used for the HTTP health check ping. If not set, the HTTP + health check will be disabled and a TCP health check used + instead. + "initial_delay_seconds": 0, # Optional. The + number of seconds to wait before beginning health checks. + "period_seconds": 0, # Optional. The number + of seconds to wait between health checks. + "port": 0, # Optional. The port on which the + health check will be performed. If not set, the health check will + be performed on the component's http_port. + "success_threshold": 0, # Optional. The + number of successful health checks before considered healthy. + "timeout_seconds": 0 # Optional. The number + of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal port on + which this service's run command will listen. Default: 8080 If there + is not an environment variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which this + service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "workers": [ + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "routes": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, # Optional. The number + of seconds to wait between selecting a container instance for + termination and issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain of new + requests on upstream load-balancers. (Default 15). + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "catchall_document": "str", # Optional. The name of + the document to use as the fallback for any requests to documents + that are not found when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. + "error_document": "404.html", # Optional. Default + value is "404.html". The name of the error document to use when + serving this static site. Default: 404.html. If no such file exists + within the built assets, App Platform will supply one. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "index_document": "index.html", # Optional. Default + value is "index.html". The name of the index document to use when + serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "output_dir": "str", # Optional. An optional path to + where the built assets will be located, relative to the build + context. If not set, App Platform will automatically scan for these + directory names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } ], - "domains": [ + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ] + }, + "project_id": "str" # Optional. The ID of the project the app should be + assigned to. If omitted, it will be assigned to your default project. + } + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. } - ] - }, - "jobs": [ + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -27049,643 +25083,852 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. } ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. "workers": [ { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } } ] }, - "pinned_deployment": { + "active_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -27734,8 +25977,8 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -27766,8 +26009,8 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -27799,8 +26042,12 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -27810,11 +26057,9 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -27832,22 +26077,22 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -27857,6 +26102,8 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -27941,13 +26188,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -27985,6 +26232,7 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -27995,8 +26243,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -28004,10 +26255,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -28018,8 +26265,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -28186,13 +26431,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -28246,15 +26491,15 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -28278,13 +26523,14 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -28295,8 +26541,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -28304,10 +26553,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -28334,8 +26579,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -28423,13 +26666,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -28493,9 +26736,9 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -28513,15 +26756,15 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -28548,6 +26791,7 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -28558,8 +26802,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -28567,10 +26814,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -28692,13 +26935,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -28757,15 +27000,15 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -28778,6 +27021,7 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -28788,8 +27032,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -28797,10 +27044,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -28879,13 +27122,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -28939,15 +27182,15 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -28970,6 +27213,7 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -28980,8 +27224,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -28989,10 +27236,6 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -29042,50 +27285,38 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { "domain": "str", # The hostname for the domain. Required. "minimum_tls_version": "str", # Optional. @@ -29095,232 +27326,241 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. } ], - "ingress": { - "rules": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -29367,1256 +27607,428 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_apps_create_request( - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def delete(self, id: str, **kwargs: Any) -> JSON: - """Delete an App. - - Delete an existing app. Once deleted, all active deployments will be permanently shut down and - the app deleted. If needed, be sure to back up your app specification so that you may re-create - it at a later time. - - :param id: The ID of the app. Required. - :type id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "id": "str" # Optional. The ID of the app that was deleted. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_delete_request( - id=id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: - """Retrieve an Existing App. - - Retrieve details about an existing app by either its ID or name. To retrieve an app by its - name, do not include an ID in the request path. Information about the current active deployment - as well as any in progress ones will also be included in the response. - - :param id: The ID of the app. Required. - :type id: str - :keyword name: The name of the app to retrieve. Default value is None. - :paramtype name: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] } ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -30663,6 +28075,16 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. "envs": [ { "key": "str", # The @@ -30670,495 +28092,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -31222,9 +28162,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -31242,15 +28182,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -31277,6 +28217,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -31287,8 +28228,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -31296,10 +28240,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -31421,13 +28361,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -31486,15 +28426,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -31507,6 +28447,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -31517,8 +28458,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -31526,10 +28470,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -31608,13 +28548,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -31668,15 +28608,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -31699,6 +28639,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -31709,8 +28650,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -31718,10 +28662,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -31771,76 +28711,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -31889,8 +28768,8 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -31921,8 +28800,8 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -31954,8 +28833,12 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -31965,11 +28848,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -31987,22 +28868,22 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -32012,6 +28893,8 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -32096,13 +28979,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -32140,6 +29023,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -32150,8 +29034,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -32159,10 +29046,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -32173,8 +29056,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -32341,13 +29222,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -32401,15 +29282,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -32433,13 +29314,14 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -32450,8 +29332,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -32459,10 +29344,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -32489,8 +29370,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -32578,13 +29457,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -32648,9 +29527,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -32668,15 +29547,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -32703,6 +29582,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -32713,8 +29593,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -32722,10 +29605,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -32847,13 +29726,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -32912,15 +29791,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -32933,6 +29812,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -32943,8 +29823,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -32952,10 +29835,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -33034,13 +29913,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -33094,15 +29973,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -33125,6 +30004,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -33135,8 +30015,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -33144,10 +30027,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -33197,15 +30076,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { + "pinned_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -33254,8 +30125,8 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -33286,8 +30157,8 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -33319,8 +30190,12 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -33330,11 +30205,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -33352,22 +30225,22 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -33377,6 +30250,8 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -33461,13 +30336,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -33505,6 +30380,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -33515,8 +30391,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -33524,10 +30403,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -33538,8 +30413,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -33706,13 +30579,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -33766,15 +30639,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -33798,13 +30671,14 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -33815,8 +30689,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -33824,10 +30701,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -33854,8 +30727,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -33943,13 +30814,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -34013,9 +30884,9 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -34033,15 +30904,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -34068,6 +30939,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -34078,8 +30950,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -34087,10 +30962,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -34212,13 +31083,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -34277,15 +31148,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -34298,6 +31169,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -34308,8 +31180,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -34317,10 +31192,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -34399,13 +31270,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -34459,15 +31330,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -34490,6 +31361,7 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -34500,8 +31372,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -34509,10 +31384,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -34562,209 +31433,503 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS } ] }, - "pinned_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_apps_create_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete(self, id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete an App. + + Delete an existing app. Once deleted, all active deployments will be permanently shut down and + the app deleted. If needed, be sure to back up your app specification so that you may re-create + it at a later time. + + :param id: The ID of the app. Required. + :type id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "id": "str" # Optional. The ID of the app that was deleted. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_delete_request( + id=id, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an Existing App. + + Retrieve details about an existing app by either its ID or name. To retrieve an app by its + name, do not include an ID in the request path. Information about the current active deployment + as well as any in progress ones will also be included in the response. + + :param id: The ID of the app. Required. + :type id: str + :keyword name: The name of the app to retrieve. Default value is None. + :paramtype name: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "domains": [ { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. } ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". }, - "services": [ + "functions": [ { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -34811,701 +31976,1058 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "active_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -35552,16 +33074,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. "envs": [ { "key": "str", # The @@ -35569,13 +33081,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -35585,11 +33097,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS used. } ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -35617,44 +33124,8 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -35665,8 +33136,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -35674,10 +33148,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -35688,13 +33158,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS Papertrail syslog endpoint. Required. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -35711,39 +33174,144 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS the path will remain ``/api/list``. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. } ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. } }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. "environment_slug": "str", # Optional. An environment slug describing the type of this app. For a full list, please refer to `the product @@ -35756,13 +33324,13 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -35816,15 +33384,15 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -35846,7 +33414,16 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -35857,8 +33434,11 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -35866,10 +33446,6 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -35895,309 +33471,31 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS causes immediate shutdown. (Default 120). } } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -36244,2289 +33542,1655 @@ async def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JS cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. } ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. "workers": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. } ] }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_request( - id=id, - name=name, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @overload - async def update( - self, - id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - """Update an App. - - Update an existing app by submitting a new app specification. For documentation on app - specifications (\ ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param id: The ID of the app. Required. - :type id: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "spec": { - "databases": [ + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ { - "cluster_name": "str", # Optional. The name of the - underlying DigitalOcean DBaaS cluster. This is required for - production databases. For dev databases, if cluster_name is not set, - a new cluster will be provisioned. - "db_name": "str", # Optional. The name of the MySQL - or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of the MySQL - or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. - "production": bool, # Optional. Whether this is a - production or dev database. - "version": "str" # Optional. The version of the - database engine. + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". } ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. "domains": [ { - "domain": "str", # The hostname for the domain. - Required. - "minimum_tls_version": "str", # Optional. The - minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: - "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that - is displayed as the default in the control panel, used in bindable - environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A - non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", - "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. Indicates whether the - domain includes all sub-domains, in addition to the given domain. - "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ { - "disabled": bool, # Optional. Is the - alert disabled?. - "operator": "UNSPECIFIED_OPERATOR", - # Optional. Default value is "UNSPECIFIED_OPERATOR". Known - values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": "UNSPECIFIED_RULE", # - Optional. Default value is "UNSPECIFIED_RULE". Known values - are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. Threshold - value for alert. - "window": "UNSPECIFIED_WINDOW" # - Optional. Default value is "UNSPECIFIED_WINDOW". Known values - are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] } ], - "cors": { - "allow_credentials": bool, # Optional. - Whether browsers should expose the response to the client-side - JavaScript code when the request"u2019s credentials mode is - include. This configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # Optional. The set of allowed - HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of allowed - HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. - Exact string match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "regex": "str" # Optional. - RE2 style regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For more - information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of HTTP - response headers that browsers are allowed to access. This - configures the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An optional - duration specifying how long browsers can cache the results of a - preflight request. This configures the ``Access-Control-Max-Age`` - header. - }, - "envs": [ + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] } ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. - }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". - }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. } - }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. - "routes": [ + ], + "domains": [ { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # - Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded to - the component. For example, a component with ``path=/api`` - will have requests to ``/api/list`` trimmed to ``/list``. If - this value is ``true``"" , the path will remain - ``/api/list``. + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], - "source_dir": "str" # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The name of the - component to route to. Required. - "preserve_path_prefix": "str", # - Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded to - the component. For example, a component with ``path=/api`` - will have requests to ``/api/list`` trimmed to ``/list``. If - this value is ``true``"" , the path will remain - ``/api/list``. Note: this is not applicable for Functions - Components and is mutually exclusive with ``rewrite``. - "rewrite": "str" # Optional. An - optional field that will rewrite the path of the component to - be what is specified here. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with ``path=/api`` will - have requests to ``/api/list`` trimmed to ``/list``. If you - specified the rewrite to be ``/v1/``"" , requests to - ``/api/list`` would be rewritten to ``/v1/list``. Note: this - is mutually exclusive with ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } ], - "allow_origins": [ + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # Optional. The - authority/host to redirect to. This can be a hostname or IP - address. Note: use ``port`` to set the port. - "port": 0, # Optional. The port to - redirect to. - "redirect_code": 0, # Optional. The - redirect code to use. Defaults to ``302``. Supported values - are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. The - scheme to redirect to. Supported values are ``http`` or - ``https``. Default: ``https``. - "uri": "str" # Optional. An optional - URI path to redirect to. Note: if this is specified the whole - URI of the original request will be overwritten to this - value, irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, - "build_command": "str", # Optional. An optional - build command to run while building this component from source. - "dockerfile_path": "str", # Optional. The path to - the Dockerfile relative to the root of the repo. If set, it will be - used to build this component. Otherwise, App Platform will attempt to - build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full list, - please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. } ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. - }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "instance_count": 1, # Optional. Default value is 1. - The amount of instances that this component should be scaled to. - Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", # - Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to - use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a - component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. - }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". - }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str", # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The - number of seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate shutdown. - (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. - "region": "str", # Optional. The slug form of the geographical - origin of the app. Default: ``nearest available``. Known values are: "ams", - "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, - "build_command": "str", # Optional. An optional - build command to run while building this component from source. - "cors": { - "allow_credentials": bool, # Optional. - Whether browsers should expose the response to the client-side - JavaScript code when the request"u2019s credentials mode is - include. This configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # Optional. The set of allowed - HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of allowed - HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "ingress": { + "rules": [ { - "exact": "str", # Optional. - Exact string match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "regex": "str" # Optional. - RE2 style regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For more - information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "expose_headers": [ - "str" # Optional. The set of HTTP - response headers that browsers are allowed to access. This - configures the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An optional - duration specifying how long browsers can cache the results of a - preflight request. This configures the ``Access-Control-Max-Age`` - header. + ] }, - "dockerfile_path": "str", # Optional. The path to - the Dockerfile relative to the root of the repo. If set, it will be - used to build this component. Otherwise, App Platform will attempt to - build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full list, - please refer to `the product documentation - `_. - "envs": [ + "jobs": [ { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } } ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. The - number of failed health checks before considered unhealthy. - "http_path": "str", # Optional. The route - path used for the HTTP health check ping. If not set, the HTTP - health check will be disabled and a TCP health check used - instead. - "initial_delay_seconds": 0, # Optional. The - number of seconds to wait before beginning health checks. - "period_seconds": 0, # Optional. The number - of seconds to wait between health checks. - "port": 0, # Optional. The port on which the - health check will be performed. If not set, the health check will - be performed on the component's http_port. - "success_threshold": 0, # Optional. The - number of successful health checks before considered healthy. - "timeout_seconds": 0 # Optional. The number - of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there - is not an environment variable with the name ``PORT``"" , one will be - automatically added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. - }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "instance_count": 1, # Optional. Default value is 1. - The amount of instances that this component should be scaled to. - Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", # - Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to - use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which this - service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. - }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". - }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "routes": [ + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # - Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded to - the component. For example, a component with ``path=/api`` - will have requests to ``/api/list`` trimmed to ``/list``. If - this value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str", # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - "termination": { - "drain_seconds": 0, # Optional. The number - of seconds to wait between selecting a container instance for - termination and issuing the TERM signal. Selecting a container - instance for termination begins an asynchronous drain of new - requests on upstream load-balancers. (Default 15). - "grace_period_seconds": 0 # Optional. The - number of seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate shutdown. - (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An optional - build command to run while building this component from source. - "catchall_document": "str", # Optional. The name of - the document to use as the fallback for any requests to documents - that are not found when serving this static site. Only 1 of - ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # Optional. - Whether browsers should expose the response to the client-side - JavaScript code when the request"u2019s credentials mode is - include. This configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # Optional. The set of allowed - HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of allowed - HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. - Exact string match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "regex": "str" # Optional. - RE2 style regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For more - information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. + }, + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "expose_headers": [ - "str" # Optional. The set of HTTP - response headers that browsers are allowed to access. This - configures the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An optional - duration specifying how long browsers can cache the results of a - preflight request. This configures the ``Access-Control-Max-Age`` - header. - }, - "dockerfile_path": "str", # Optional. The path to - the Dockerfile relative to the root of the repo. If set, it will be - used to build this component. Otherwise, App Platform will attempt to - build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full list, - please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. } ], - "error_document": "404.html", # Optional. Default - value is "404.html". The name of the error document to use when - serving this static site. Default: 404.html. If no such file exists - within the built assets, App Platform will supply one. - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. - }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "index_document": "index.html", # Optional. Default - value is "index.html". The name of the index document to use when - serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. - }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". - }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "output_dir": "str", # Optional. An optional path to - where the built assets will be located, relative to the build - context. If not set, App Platform will automatically scan for these - directory names: ``_static``"" , ``dist``"" , ``public``"" , - ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # - Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded to - the component. For example, a component with ``path=/api`` - will have requests to ``/api/list`` trimmed to ``/list``. If - this value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str" # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, - "build_command": "str", # Optional. An optional - build command to run while building this component from source. - "dockerfile_path": "str", # Optional. The path to - the Dockerfile relative to the root of the repo. If set, it will be - used to build this component. Otherwise, App Platform will attempt to - build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full list, - please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. - }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "instance_count": 1, # Optional. Default value is 1. - The amount of instances that this component should be scaled to. - Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", # - Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to - use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. - }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". - }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str", # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The - number of seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate shutdown. - (Default 120). - } - } - ] - } - } - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ + "static_sites": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -38573,6 +35237,16 @@ async def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. "envs": [ { "key": "str", # The @@ -38580,13 +35254,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -38596,6 +35270,11 @@ async def update( used. } ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -38623,7 +35302,45 @@ async def update( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -38634,8 +35351,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -38643,10 +35363,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -38657,8 +35373,13 @@ async def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -38675,131 +35396,26 @@ async def update( the path will remain ``/api/list``. } ], + "run_command": "str", # Optional. An + optional run command to override the component's default. "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. } ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, "min_instance_count": 0 # Optional. The minimum amount of instances for this @@ -38825,13 +35441,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -38885,15 +35501,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -38915,15 +35531,8 @@ async def update( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -38934,8 +35543,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -38943,10 +35555,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -38972,33 +35580,245 @@ async def update( causes immediate shutdown. (Default 120). } } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. + } + ] + }, + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { "name": "str", # The name of the app. Must be unique across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ + "databases": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -39045,16 +35865,6 @@ async def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. "envs": [ { "key": "str", # The @@ -39062,13 +35872,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -39105,88 +35915,8 @@ async def update( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -39197,8 +35927,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -39206,10 +35939,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -39220,8 +35949,6 @@ async def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. "routes": [ { "path": "str", # @@ -39238,56 +35965,348 @@ async def update( the path will remain ``/api/list``. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An + "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } } ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string match. Only 1 of ``exact``"" , ``prefix``"" , or ``regex`` must be set. @@ -39331,13 +36350,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -39347,11 +36366,6 @@ async def update( used. } ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -39379,6 +36393,36 @@ async def update( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. + }, + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -39396,15 +36440,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -39412,11 +36456,26 @@ async def update( to ``latest`` if not provided and no digest is provided. Cannot be specified if digest is provided. }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -39427,8 +36486,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -39436,10 +36498,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -39452,11 +36510,6 @@ async def update( }, "name": "str", # Optional. The name. Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -39475,32 +36528,80 @@ async def update( ], "run_command": "str", # Optional. An optional run command to override the component's default. - "source_dir": "str" # Optional. An + "source_dir": "str", # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } } ], - "workers": [ + "static_sites": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, "build_command": "str", # Optional. An optional build command to run while building this component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, "dockerfile_path": "str", # Optional. The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. @@ -39518,13 +36619,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -39534,6 +36635,11 @@ async def update( used. } ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -39578,15 +36684,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -39594,21 +36700,12 @@ async def update( to ``latest`` if not provided and no digest is provided. Cannot be specified if digest is provided. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -39619,8 +36716,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -39628,10 +36728,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -39644,28 +36740,220 @@ async def update( }, "name": "str", # Optional. The name. Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], "run_command": "str", # Optional. An optional run command to override the component's default. - "source_dir": "str", # Optional. An + "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. } ], "tier_slug": "str", # Optional. The current pricing tier @@ -39681,76 +36969,7 @@ async def update( } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { + "pinned_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -39799,8 +37018,8 @@ async def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -39831,8 +37050,8 @@ async def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -39864,8 +37083,12 @@ async def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -39875,11 +37098,9 @@ async def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -39897,22 +37118,22 @@ async def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -39922,6 +37143,8 @@ async def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -40006,13 +37229,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -40050,6 +37273,7 @@ async def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -40060,8 +37284,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -40069,10 +37296,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -40083,8 +37306,6 @@ async def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -40251,13 +37472,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -40311,15 +37532,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -40343,13 +37564,14 @@ async def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -40360,8 +37582,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -40369,10 +37594,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -40399,8 +37620,6 @@ async def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -40488,13 +37707,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -40558,9 +37777,9 @@ async def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -40578,15 +37797,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -40613,6 +37832,7 @@ async def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -40623,8 +37843,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -40632,10 +37855,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -40757,13 +37976,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -40822,15 +38041,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -40843,6 +38062,7 @@ async def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -40853,8 +38073,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -40862,10 +38085,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -40944,13 +38163,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -41004,15 +38223,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -41035,6 +38254,7 @@ async def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -41045,8 +38265,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -41054,10 +38277,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -41107,1592 +38326,1541 @@ async def update( } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_request( + id=id, + name=name, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def update( + self, + id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update an App. + + Update an existing app by submitting a new app specification. For documentation on app + specifications (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param id: The ID of the app. Required. + :type id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". } ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". }, - "functions": [ + "routes": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of the + component to route to. Required. + "preserve_path_prefix": "str", # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for Functions + Components and is mutually exclusive with ``rewrite``. + "rewrite": "str" # Optional. An + optional field that will rewrite the path of the component to + be what is specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with ``path=/api`` will + have requests to ``/api/list`` trimmed to ``/list``. If you + specified the rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. Note: this + is mutually exclusive with ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # Optional. The + authority/host to redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # Optional. The port to + redirect to. + "redirect_code": 0, # Optional. The + redirect code to use. Defaults to ``302``. Supported values + are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. The + scheme to redirect to. Supported values are ``http`` or + ``https``. Default: ``https``. + "uri": "str" # Optional. An optional + URI path to redirect to. Note: if this is specified the whole + URI of the original request will be overwritten to this + value, irrespective of the original request URI being + matched. } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. } - ] + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. }, - "jobs": [ + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a + component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the geographical + origin of the app. Default: ``nearest available``. Known values are: "ams", + "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. The + number of failed health checks before considered unhealthy. + "http_path": "str", # Optional. The route + path used for the HTTP health check ping. If not set, the HTTP + health check will be disabled and a TCP health check used + instead. + "initial_delay_seconds": 0, # Optional. The + number of seconds to wait before beginning health checks. + "period_seconds": 0, # Optional. The number + of seconds to wait between health checks. + "port": 0, # Optional. The port on which the + health check will be performed. If not set, the health check will + be performed on the component's http_port. + "success_threshold": 0, # Optional. The + number of successful health checks before considered healthy. + "timeout_seconds": 0 # Optional. The number + of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal port on + which this service's run command will listen. Default: 8080 If there + is not an environment variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which this + service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "static_sites": [ + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "routes": [ { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } ], - "workers": [ + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, # Optional. The number + of seconds to wait between selecting a container instance for + termination and issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain of new + requests on upstream load-balancers. (Default 15). + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "catchall_document": "str", # Optional. The name of + the document to use as the fallback for any requests to documents + that are not found when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "pinned_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. + "error_document": "404.html", # Optional. Default + value is "404.html". The name of the error document to use when + serving this static site. Default: 404.html. If no such file exists + within the built assets, App Platform will supply one. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "index_document": "index.html", # Optional. Default + value is "index.html". The name of the index document to use when + serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "output_dir": "str", # Optional. An optional path to + where the built assets will be located, relative to the build + context. If not set, App Platform will automatically scan for these + directory names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } ], - "domains": [ + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ] + } + } + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { "exact": "str", # Optional. Exact string match. Only 1 of @@ -42721,728 +39889,1085 @@ async def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "active_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. "regex": "str" # Optional. RE2 style regex-based match. Only 1 of ``exact``"" , ``prefix``"" , or @@ -43462,16 +40987,6 @@ async def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. "envs": [ { "key": "str", # The @@ -43479,13 +40994,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -43495,11 +41010,6 @@ async def update( used. } ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -43527,44 +41037,8 @@ async def update( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -43575,8 +41049,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -43584,10 +41061,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -43598,13 +41071,6 @@ async def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -43621,15 +41087,120 @@ async def update( the path will remain ``/api/list``. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. } ], - "workers": [ + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ { "autoscaling": { "max_instance_count": 0, # @@ -43666,13 +41237,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -43726,15 +41297,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -43756,7 +41327,16 @@ async def update( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -43767,8 +41347,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -43776,10 +41359,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -43805,309 +41384,31 @@ async def update( causes immediate shutdown. (Default 120). } } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -44154,905 +41455,712 @@ async def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. } ] }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - async def update( - self, - id: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - """Update an App. - - Update an existing app by submitting a new app specification. For documentation on app - specifications (\ ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param id: The ID of the app. Required. - :type id: str - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -45101,8 +42209,8 @@ async def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -45133,8 +42241,8 @@ async def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -45166,8 +42274,12 @@ async def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -45177,11 +42289,9 @@ async def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -45199,22 +42309,22 @@ async def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -45224,6 +42334,8 @@ async def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -45308,13 +42420,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -45352,6 +42464,7 @@ async def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -45362,8 +42475,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -45371,10 +42487,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -45385,8 +42497,6 @@ async def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -45553,13 +42663,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -45613,15 +42723,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -45645,13 +42755,14 @@ async def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -45662,8 +42773,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -45671,10 +42785,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -45701,8 +42811,6 @@ async def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -45790,13 +42898,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -45860,9 +42968,9 @@ async def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -45880,15 +42988,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -45915,6 +43023,7 @@ async def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -45925,8 +43034,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -45934,10 +43046,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -46059,13 +43167,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -46124,15 +43232,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -46145,6 +43253,7 @@ async def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -46155,8 +43264,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -46164,10 +43276,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -46246,13 +43354,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -46306,15 +43414,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -46337,6 +43445,7 @@ async def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -46347,8 +43456,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -46356,10 +43468,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -46409,76 +43517,15 @@ async def update( } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -46527,8 +43574,8 @@ async def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -46559,8 +43606,8 @@ async def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -46592,8 +43639,12 @@ async def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -46603,11 +43654,9 @@ async def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -46625,22 +43674,22 @@ async def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -46650,6 +43699,8 @@ async def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -46734,13 +43785,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -46778,6 +43829,7 @@ async def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -46788,8 +43840,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -46797,10 +43852,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -46811,8 +43862,6 @@ async def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -46979,13 +44028,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47039,15 +44088,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -47071,13 +44120,14 @@ async def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -47088,8 +44138,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -47097,10 +44150,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -47127,8 +44176,6 @@ async def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -47216,13 +44263,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47286,9 +44333,9 @@ async def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -47306,15 +44353,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -47341,6 +44388,7 @@ async def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -47351,8 +44399,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -47360,10 +44411,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -47485,13 +44532,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47550,15 +44597,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -47571,6 +44618,7 @@ async def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -47581,8 +44629,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -47590,10 +44641,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -47672,13 +44719,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47732,15 +44779,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -47763,6 +44810,7 @@ async def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -47773,8 +44821,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -47782,10 +44833,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -47835,15 +44882,7 @@ async def update( } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { + "pinned_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -47892,8 +44931,8 @@ async def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -47924,8 +44963,8 @@ async def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -47957,8 +44996,12 @@ async def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -47968,11 +45011,9 @@ async def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -47990,22 +45031,22 @@ async def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -48015,6 +45056,8 @@ async def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -48099,13 +45142,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -48143,6 +45186,7 @@ async def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -48153,8 +45197,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -48162,10 +45209,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -48176,8 +45219,6 @@ async def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -48344,13 +45385,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -48404,15 +45445,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -48436,13 +45477,14 @@ async def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -48453,8 +45495,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -48462,10 +45507,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -48492,8 +45533,6 @@ async def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -48581,13 +45620,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -48651,9 +45690,9 @@ async def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -48671,15 +45710,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -48706,6 +45745,7 @@ async def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -48716,8 +45756,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -48725,10 +45768,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -48850,13 +45889,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -48915,15 +45954,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -48936,6 +45975,7 @@ async def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -48946,8 +45986,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -48955,10 +45998,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -49037,13 +46076,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -49097,15 +46136,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -49128,6 +46167,7 @@ async def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -49138,8 +46178,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -49147,10 +46190,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -49200,209 +46239,339 @@ async def update( } ] }, - "pinned_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def update( + self, + id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update an App. + + Update an existing app by submitting a new app specification. For documentation on app + specifications (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param id: The ID of the app. Required. + :type id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "domains": [ { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. } ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". }, - "services": [ + "functions": [ { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -49449,729 +46618,1086 @@ async def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "active_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": "str" # Optional. RE2 style regex-based match. Only 1 of ``exact``"" , ``prefix``"" , or ``regex`` must be set. For more information about @@ -50190,16 +47716,6 @@ async def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. "envs": [ { "key": "str", # The @@ -50207,13 +47723,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -50223,11 +47739,6 @@ async def update( used. } ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -50255,44 +47766,8 @@ async def update( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -50303,8 +47778,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -50312,10 +47790,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -50326,13 +47800,6 @@ async def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -50349,15 +47816,120 @@ async def update( the path will remain ``/api/list``. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. } ], - "workers": [ + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ { "autoscaling": { "max_instance_count": 0, # @@ -50394,13 +47966,13 @@ async def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -50454,15 +48026,15 @@ async def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -50484,7 +48056,16 @@ async def update( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -50495,8 +48076,11 @@ async def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -50504,10 +48088,6 @@ async def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -50533,309 +48113,31 @@ async def update( causes immediate shutdown. (Default 120). } } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -50882,898 +48184,712 @@ async def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. } ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. "workers": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. } ] }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace_async - async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Update an App. - - Update an existing app by submitting a new app specification. For documentation on app - specifications (\ ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param id: The ID of the app. Required. - :type id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -51822,8 +48938,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -51854,8 +48970,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -51887,8 +49003,12 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -51898,11 +49018,9 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -51920,22 +49038,22 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -51945,6 +49063,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -52029,13 +49149,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -52073,6 +49193,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -52083,8 +49204,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -52092,10 +49216,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -52106,8 +49226,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -52274,13 +49392,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -52334,15 +49452,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -52366,13 +49484,14 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -52383,8 +49502,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -52392,10 +49514,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -52422,8 +49540,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -52511,13 +49627,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -52581,9 +49697,9 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -52601,15 +49717,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -52636,6 +49752,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -52646,8 +49763,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -52655,10 +49775,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -52780,13 +49896,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -52845,15 +49961,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -52866,6 +49982,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -52876,8 +49993,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -52885,10 +50005,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -52967,13 +50083,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -53027,15 +50143,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -53058,6 +50174,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -53068,8 +50185,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -53077,10 +50197,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -53130,76 +50246,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -53248,8 +50303,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -53280,8 +50335,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -53313,8 +50368,12 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -53324,11 +50383,9 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -53346,22 +50403,22 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -53371,6 +50428,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -53455,13 +50514,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -53499,6 +50558,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -53509,8 +50569,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -53518,10 +50581,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -53532,8 +50591,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -53700,13 +50757,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -53760,15 +50817,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -53792,13 +50849,14 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -53809,8 +50867,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -53818,10 +50879,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -53848,8 +50905,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -53937,13 +50992,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -54007,9 +51062,9 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -54027,15 +51082,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -54062,6 +51117,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -54072,8 +51128,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -54081,10 +51140,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -54206,13 +51261,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -54271,15 +51326,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -54292,6 +51347,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -54302,8 +51358,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -54311,10 +51370,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -54393,13 +51448,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -54453,15 +51508,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -54484,6 +51539,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -54494,8 +51550,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -54503,10 +51562,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -54556,15 +51611,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { + "pinned_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -54613,8 +51660,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -54645,8 +51692,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -54678,8 +51725,12 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -54689,11 +51740,9 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -54711,22 +51760,22 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -54736,6 +51785,8 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -54820,13 +51871,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -54864,6 +51915,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -54874,8 +51926,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -54883,10 +51938,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -54897,8 +51948,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -55065,13 +52114,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -55125,15 +52174,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -55157,13 +52206,14 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -55174,8 +52224,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -55183,10 +52236,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -55213,8 +52262,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -55302,13 +52349,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -55372,9 +52419,9 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -55392,15 +52439,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -55427,6 +52474,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -55437,8 +52485,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -55446,10 +52497,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -55571,13 +52618,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -55636,15 +52683,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -55657,6 +52704,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -55667,8 +52715,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -55676,10 +52727,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -55758,13 +52805,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -55818,15 +52865,15 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -55849,6 +52896,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -55859,8 +52907,11 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -55868,10 +52919,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -55921,1559 +52968,1357 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "pinned_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update( + self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update an App. + + Update an existing app by submitting a new app specification. For documentation on app + specifications (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param id: The ID of the app. Required. + :type id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". } ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". }, - "functions": [ + "routes": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of the + component to route to. Required. + "preserve_path_prefix": "str", # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for Functions + Components and is mutually exclusive with ``rewrite``. + "rewrite": "str" # Optional. An + optional field that will rewrite the path of the component to + be what is specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with ``path=/api`` will + have requests to ``/api/list`` trimmed to ``/list``. If you + specified the rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. Note: this + is mutually exclusive with ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # Optional. The + authority/host to redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # Optional. The port to + redirect to. + "redirect_code": 0, # Optional. The + redirect code to use. Defaults to ``302``. Supported values + are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. The + scheme to redirect to. Supported values are ``http`` or + ``https``. Default: ``https``. + "uri": "str" # Optional. An optional + URI path to redirect to. Note: if this is specified the whole + URI of the original request will be overwritten to this + value, irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a + component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the geographical + origin of the app. Default: ``nearest available``. Known values are: "ams", + "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. The + number of failed health checks before considered unhealthy. + "http_path": "str", # Optional. The route + path used for the HTTP health check ping. If not set, the HTTP + health check will be disabled and a TCP health check used + instead. + "initial_delay_seconds": 0, # Optional. The + number of seconds to wait before beginning health checks. + "period_seconds": 0, # Optional. The number + of seconds to wait between health checks. + "port": 0, # Optional. The port on which the + health check will be performed. If not set, the health check will + be performed on the component's http_port. + "success_threshold": 0, # Optional. The + number of successful health checks before considered healthy. + "timeout_seconds": 0 # Optional. The number + of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal port on + which this service's run command will listen. Default: 8080 If there + is not an environment variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which this + service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "static_sites": [ + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "routes": [ { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, # Optional. The number + of seconds to wait between selecting a container instance for + termination and issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain of new + requests on upstream load-balancers. (Default 15). + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "catchall_document": "str", # Optional. The name of + the document to use as the fallback for any requests to documents + that are not found when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. Default + value is "404.html". The name of the error document to use when + serving this static site. Default: 404.html. If no such file exists + within the built assets, App Platform will supply one. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "index_document": "index.html", # Optional. Default + value is "index.html". The name of the index document to use when + serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "output_dir": "str", # Optional. An optional path to + where the built assets will be located, relative to the build + context. If not set, App Platform will automatically scan for these + directory names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ] + } + } + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -57484,18 +54329,17 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -57506,8 +54350,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -57668,13 +54510,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -57723,13 +54565,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -57752,13 +54594,14 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -57769,18 +54612,17 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -57807,8 +54649,6 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -57890,13 +54730,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -57954,7 +54794,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -57972,13 +54812,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -58004,6 +54844,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -58014,18 +54855,17 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -58140,13 +54980,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -58200,13 +55040,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -58220,6 +55060,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -58230,18 +55071,17 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -58318,13 +55158,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -58373,13 +55213,13 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -58401,6 +55241,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -58411,18 +55252,17 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -58450,275 +55290,7 @@ async def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_apps_update_request( - id=id, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def get_logs_active_deployment( - self, - app_id: str, - component_name: str, - *, - follow: Optional[bool] = None, - type: str = "UNSPECIFIED", - pod_connection_timeout: Optional[str] = None, - **kwargs: Any - ) -> JSON: - """Retrieve Active Deployment Logs. - - Retrieve the logs of the active deployment if one exists. The response will include links to - either real-time logs of an in-progress or active deployment or archived logs of a past - deployment. Note log_type=BUILD logs will return logs associated with the current active - deployment (being served). To view build logs associated with in-progress build, the query must - explicitly reference the deployment id. - - :param app_id: The app ID. Required. - :type app_id: str - :param component_name: An optional component name. If set, logs will be limited to this - component only. Required. - :type component_name: str - :keyword follow: Whether the logs should follow live updates. Default value is None. - :paramtype follow: bool - :keyword type: The type of logs to retrieve - - - * BUILD: Build-time logs - * DEPLOY: Deploy-time logs - * RUN: Live run-time logs - * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: - "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". - :paramtype type: str - :keyword pod_connection_timeout: An optional time duration to wait if the underlying component - instance is not immediately available. Default: ``3m``. Default value is None. - :paramtype pod_connection_timeout: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "historic_urls": [ - "str" # Optional. A list of URLs to archived log files. - ], - "live_url": "str" # Optional. A URL of the real-time live logs. This URL may - use either the ``https://`` or ``wss://`` protocols and will keep pushing live - logs as they become available. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_logs_active_deployment_request( - app_id=app_id, - component_name=component_name, - follow=follow, - type=type, - pod_connection_timeout=pod_connection_timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def list_deployments( - self, app_id: str, *, page: int = 1, per_page: int = 20, **kwargs: Any - ) -> JSON: - """List App Deployments. - - List all deployments of an app. - - :param app_id: The app ID. Required. - :type app_id: str - :keyword page: Which 'page' of paginated results to return. Default value is 1. - :paramtype page: int - :keyword per_page: Number of items returned per page. Default value is 20. - :paramtype per_page: int - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "deployments": [ - { + "active_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -58767,8 +55339,8 @@ async def list_deployments( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -58799,8 +55371,8 @@ async def list_deployments( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -58832,8 +55404,12 @@ async def list_deployments( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -58843,11 +55419,9 @@ async def list_deployments( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -58865,22 +55439,22 @@ async def list_deployments( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -58890,6 +55464,8 @@ async def list_deployments( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -58974,13 +55550,13 @@ async def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59018,6 +55594,7 @@ async def list_deployments( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -59028,8 +55605,11 @@ async def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -59037,10 +55617,6 @@ async def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -59051,8 +55627,6 @@ async def list_deployments( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -59219,13 +55793,13 @@ async def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59279,15 +55853,15 @@ async def list_deployments( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -59311,13 +55885,14 @@ async def list_deployments( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -59328,8 +55903,11 @@ async def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -59337,10 +55915,6 @@ async def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -59367,8 +55941,6 @@ async def list_deployments( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -59456,13 +56028,13 @@ async def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59526,9 +56098,9 @@ async def list_deployments( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -59546,15 +56118,15 @@ async def list_deployments( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -59581,6 +56153,7 @@ async def list_deployments( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -59591,8 +56164,11 @@ async def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -59600,10 +56176,6 @@ async def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -59725,13 +56297,13 @@ async def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59790,15 +56362,15 @@ async def list_deployments( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -59811,6 +56383,7 @@ async def list_deployments( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -59821,8 +56394,11 @@ async def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -59830,10 +56406,6 @@ async def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -59912,13 +56484,13 @@ async def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59972,15 +56544,15 @@ async def list_deployments( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -60003,6 +56575,7 @@ async def list_deployments( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -60013,8 +56586,11 @@ async def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -60022,10 +56598,6 @@ async def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -60074,266 +56646,39 @@ async def list_deployments( commit hash of the repository that was used to build this worker. } ] - } - ], - "links": { - "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_list_deployments_request( - app_id=app_id, - page=page, - per_page=per_page, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @overload - async def create_deployment( - self, - app_id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - """Create an App Deployment. - - Creating an app deployment will pull the latest changes from your repository and schedule a new - deployment for your app. - - :param app_id: The app ID. Required. - :type app_id: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "force_build": bool # Optional. Indicates whether to force a build of app - from source even if an existing cached build is suitable for re-use. - } - - # response body for status code(s): 200 - response == { - "deployment": { - "cause": "str", # Optional. What caused this deployment to be - created. - "cloned_from": "str", # Optional. The ID of a previous deployment - that this deployment was cloned from. + }, "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the deployment. - "functions": [ + of the app. + "dedicated_ips": [ { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The namespace where - the functions are deployed. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this functions - component. + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ { - "name": "str", # Optional. The name of this job. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known - values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", - "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful steps. - "pending_steps": 0, # Optional. Number of pending steps. - "running_steps": 0, # Optional. Number of currently running - steps. - "steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful steps. - "summary_steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { "steps": [ - {} # Optional. Child steps of this - step. + {} # Optional. The steps of the + domain's progress. ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this service. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { "domain": "str", # The hostname for the domain. Required. "minimum_tls_version": "str", # Optional. @@ -60343,232 +56688,241 @@ async def create_deployment( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. } ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -60615,1282 +56969,697 @@ async def create_deployment( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. + }, + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this static - site. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this static site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier slug of the - deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment - was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this worker. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this worker. - } - ] - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - async def create_deployment( - self, - app_id: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - """Create an App Deployment. - - Creating an app deployment will pull the latest changes from your repository and schedule a new - deployment for your app. - - :param app_id: The app ID. Required. - :type app_id: str - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "deployment": { - "cause": "str", # Optional. What caused this deployment to be - created. - "cloned_from": "str", # Optional. The ID of a previous deployment - that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The namespace where - the functions are deployed. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this functions - component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this job. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known - values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", - "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful steps. - "pending_steps": 0, # Optional. Number of pending steps. - "running_steps": 0, # Optional. Number of currently running - steps. - "steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful steps. - "summary_steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this service. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. ], - "allow_origins": [ + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + } + ], + "static_sites": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -61937,1277 +57706,1056 @@ async def create_deployment( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. + } + ] + }, + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. } ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this static - site. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this static site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier slug of the - deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment - was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this worker. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this worker. - } - ] - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace_async - async def create_deployment( - self, app_id: str, body: Union[JSON, IO], **kwargs: Any - ) -> JSON: - """Create an App Deployment. - - Creating an app deployment will pull the latest changes from your repository and schedule a new - deployment for your app. - - :param app_id: The app ID. Required. - :type app_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "deployment": { - "cause": "str", # Optional. What caused this deployment to be - created. - "cloned_from": "str", # Optional. The ID of a previous deployment - that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The namespace where - the functions are deployed. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this functions - component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this job. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known - values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", - "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful steps. - "pending_steps": 0, # Optional. Number of pending steps. - "running_steps": 0, # Optional. Number of currently running - steps. - "steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful steps. - "summary_steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this service. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -63254,1357 +58802,849 @@ async def create_deployment( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this static - site. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this static site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier slug of the - deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment - was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this worker. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this worker. - } - ] - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_apps_create_deployment_request( - app_id=app_id, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def get_deployment( - self, app_id: str, deployment_id: str, **kwargs: Any - ) -> JSON: - """Retrieve an App Deployment. - - Retrieve information about an app deployment. - - :param app_id: The app ID. Required. - :type app_id: str - :param deployment_id: The deployment ID. Required. - :type deployment_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "deployment": { - "cause": "str", # Optional. What caused this deployment to be - created. - "cloned_from": "str", # Optional. The ID of a previous deployment - that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The namespace where - the functions are deployed. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this functions - component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this job. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known - values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", - "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful steps. - "pending_steps": 0, # Optional. Number of pending steps. - "running_steps": 0, # Optional. Number of currently running - steps. - "steps": [ + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. } - ], - "success_steps": 0, # Optional. Number of successful steps. - "summary_steps": [ + ] + }, + "pinned_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this service. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this service. - } - ], - "spec": { - "databases": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. } ], - "domains": [ + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -64651,918 +59691,1349 @@ async def get_deployment( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this static - site. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this static site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier slug of the - deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment - was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this worker. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this worker. - } - ] - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. + } + ] + }, + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_apps_update_request( + id=id, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_logs_active_deployment( + self, + app_id: str, + component_name: str, + *, + follow: Optional[bool] = None, + type: str = "UNSPECIFIED", + pod_connection_timeout: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Active Deployment Logs. + + Retrieve the logs of the active deployment if one exists. The response will include links to + either real-time logs of an in-progress or active deployment or archived logs of a past + deployment. Note log_type=BUILD logs will return logs associated with the current active + deployment (being served). To view build logs associated with in-progress build, the query must + explicitly reference the deployment id. + + :param app_id: The app ID. Required. + :type app_id: str + :param component_name: An optional component name. If set, logs will be limited to this + component only. Required. + :type component_name: str + :keyword follow: Whether the logs should follow live updates. Default value is None. + :paramtype follow: bool + :keyword type: The type of logs to retrieve + + + * BUILD: Build-time logs + * DEPLOY: Deploy-time logs + * RUN: Live run-time logs + * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: + "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". + :paramtype type: str + :keyword pod_connection_timeout: An optional time duration to wait if the underlying component + instance is not immediately available. Default: ``3m``. Default value is None. + :paramtype pod_connection_timeout: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "historic_urls": [ + "str" # Optional. A list of URLs to archived log files. + ], + "live_url": "str" # Optional. A URL of the real-time live logs. This URL may + use either the ``https://`` or ``wss://`` protocols and will keep pushing live + logs as they become available. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_get_deployment_request( + _request = build_apps_get_logs_active_deployment_request( app_id=app_id, - deployment_id=deployment_id, + component_name=component_name, + follow=follow, + type=type, + pod_connection_timeout=pod_connection_timeout, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -65599,22 +61070,25 @@ async def get_deployment( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def cancel_deployment( - self, app_id: str, deployment_id: str, **kwargs: Any + async def list_deployments( + self, app_id: str, *, page: int = 1, per_page: int = 20, **kwargs: Any ) -> JSON: - """Cancel a Deployment. + # pylint: disable=line-too-long + """List App Deployments. - Immediately cancel an in-progress deployment. + List all deployments of an app. :param app_id: The app ID. Required. :type app_id: str - :param deployment_id: The deployment ID. Required. - :type deployment_id: str + :keyword page: Which 'page' of paginated results to return. Default value is 1. + :paramtype page: int + :keyword per_page: Number of items returned per page. Default value is 20. + :paramtype per_page: int :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -65624,371 +61098,217 @@ async def cancel_deployment( # response body for status code(s): 200 response == { - "deployment": { - "cause": "str", # Optional. What caused this deployment to be - created. - "cloned_from": "str", # Optional. The ID of a previous deployment - that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The namespace where - the functions are deployed. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this functions - component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this job. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known - values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", - "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful steps. - "pending_steps": 0, # Optional. Number of pending steps. - "running_steps": 0, # Optional. Number of currently running - steps. - "steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful steps. - "summary_steps": [ + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, + "deployments": [ + { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this service. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this service. - } - ], - "spec": { - "databases": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. } ], - "domains": [ + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -66035,1012 +61355,1114 @@ async def cancel_deployment( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this static - site. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this static site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier slug of the - deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment - was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this worker. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this worker. - } - ] - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_cancel_deployment_request( - app_id=app_id, - deployment_id=deployment_id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def get_logs( - self, - app_id: str, - deployment_id: str, - component_name: str, - *, - follow: Optional[bool] = None, - type: str = "UNSPECIFIED", - pod_connection_timeout: Optional[str] = None, - **kwargs: Any - ) -> JSON: - """Retrieve Deployment Logs. - - Retrieve the logs of a past, in-progress, or active deployment. The response will include links - to either real-time logs of an in-progress or active deployment or archived logs of a past - deployment. - - :param app_id: The app ID. Required. - :type app_id: str - :param deployment_id: The deployment ID. Required. - :type deployment_id: str - :param component_name: An optional component name. If set, logs will be limited to this - component only. Required. - :type component_name: str - :keyword follow: Whether the logs should follow live updates. Default value is None. - :paramtype follow: bool - :keyword type: The type of logs to retrieve - - - * BUILD: Build-time logs - * DEPLOY: Deploy-time logs - * RUN: Live run-time logs - * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: - "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". - :paramtype type: str - :keyword pod_connection_timeout: An optional time duration to wait if the underlying component - instance is not immediately available. Default: ``3m``. Default value is None. - :paramtype pod_connection_timeout: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "historic_urls": [ - "str" # Optional. A list of URLs to archived log files. + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. + } + ] + } ], - "live_url": "str" # Optional. A URL of the real-time live logs. This URL may - use either the ``https://`` or ``wss://`` protocols and will keep pushing live - logs as they become available. + "links": { + "pages": {} + } } # response body for status code(s): 404 response == { @@ -67054,10 +62476,14 @@ async def get_logs( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -67066,30 +62492,30 @@ async def get_logs( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_get_logs_request( + _request = build_apps_list_deployments_request( app_id=app_id, - deployment_id=deployment_id, - component_name=component_name, - follow=follow, - type=type, - pod_connection_timeout=pod_connection_timeout, + page=page, + per_page=per_page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -67126,46 +62552,32 @@ async def get_logs( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore - @distributed_trace_async - async def get_logs_aggregate( + @overload + async def create_deployment( self, app_id: str, - deployment_id: str, + body: JSON, *, - follow: Optional[bool] = None, - type: str = "UNSPECIFIED", - pod_connection_timeout: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any ) -> JSON: - """Retrieve Aggregate Deployment Logs. + # pylint: disable=line-too-long + """Create an App Deployment. - Retrieve the logs of a past, in-progress, or active deployment. If a component name is - specified, the logs will be limited to only that component. The response will include links to - either real-time logs of an in-progress or active deployment or archived logs of a past - deployment. + Creating an app deployment will pull the latest changes from your repository and schedule a new + deployment for your app. :param app_id: The app ID. Required. :type app_id: str - :param deployment_id: The deployment ID. Required. - :type deployment_id: str - :keyword follow: Whether the logs should follow live updates. Default value is None. - :paramtype follow: bool - :keyword type: The type of logs to retrieve - - - * BUILD: Build-time logs - * DEPLOY: Deploy-time logs - * RUN: Live run-time logs - * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: - "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". - :paramtype type: str - :keyword pod_connection_timeout: An optional time duration to wait if the underlying component - instance is not immediately available. Default: ``3m``. Default value is None. - :paramtype pod_connection_timeout: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -67173,785 +62585,8967 @@ async def get_logs_aggregate( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "historic_urls": [ - "str" # Optional. A list of URLs to archived log files. - ], - "live_url": "str" # Optional. A URL of the real-time live logs. This URL may - use either the ``https://`` or ``wss://`` protocols and will keep pushing live - logs as they become available. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. + # JSON input template you can fill out and use as your body input. + body = { + "force_build": bool # Optional. Indicates whether to force a build of app + from source even if an existing cached build is suitable for re-use. } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_logs_aggregate_request( - app_id=app_id, - deployment_id=deployment_id, - follow=follow, - type=type, - pod_connection_timeout=pod_connection_timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def get_logs_active_deployment_aggregate( - self, - app_id: str, - *, - follow: Optional[bool] = None, - type: str = "UNSPECIFIED", - pod_connection_timeout: Optional[str] = None, - **kwargs: Any - ) -> JSON: - """Retrieve Active Deployment Aggregate Logs. - - Retrieve the logs of the active deployment if one exists. The response will include links to - either real-time logs of an in-progress or active deployment or archived logs of a past - deployment. Note log_type=BUILD logs will return logs associated with the current active - deployment (being served). To view build logs associated with in-progress build, the query must - explicitly reference the deployment id. - - :param app_id: The app ID. Required. - :type app_id: str - :keyword follow: Whether the logs should follow live updates. Default value is None. - :paramtype follow: bool - :keyword type: The type of logs to retrieve - - - * BUILD: Build-time logs - * DEPLOY: Deploy-time logs - * RUN: Live run-time logs - * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: - "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". - :paramtype type: str - :keyword pod_connection_timeout: An optional time duration to wait if the underlying component - instance is not immediately available. Default: ``3m``. Default value is None. - :paramtype pod_connection_timeout: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "historic_urls": [ - "str" # Optional. A list of URLs to archived log files. - ], - "live_url": "str" # Optional. A URL of the real-time live logs. This URL may - use either the ``https://`` or ``wss://`` protocols and will keep pushing live - logs as they become available. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_logs_active_deployment_aggregate_request( - app_id=app_id, - follow=follow, - type=type, - pod_connection_timeout=pod_connection_timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def list_tiers(self, **kwargs: Any) -> JSON: - """List App Tiers. - - List all app tiers. - - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "tiers": [ - { - "build_seconds": "str", # Optional. The amount of included - build time in seconds. - "egress_bandwidth_bytes": "str", # Optional. The amount of - included outbound bandwidth in bytes. - "name": "str", # Optional. A human-readable name of the - tier. - "slug": "str", # Optional. The slug of the tier. - "storage_bytes": "str" # Optional. The allotted disk space - in bytes. - } - ] - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_list_tiers_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def get_tier(self, slug: str, **kwargs: Any) -> JSON: - """Retrieve an App Tier. - - Retrieve information about a specific app tier. - - :param slug: The slug of the tier. Required. - :type slug: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "tier": { - "build_seconds": "str", # Optional. The amount of included build - time in seconds. - "egress_bandwidth_bytes": "str", # Optional. The amount of included - outbound bandwidth in bytes. - "name": "str", # Optional. A human-readable name of the tier. - "slug": "str", # Optional. The slug of the tier. - "storage_bytes": "str" # Optional. The allotted disk space in bytes. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_tier_request( - slug=slug, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def list_instance_sizes(self, **kwargs: Any) -> JSON: - """List Instance Sizes. - - List all instance sizes for ``service``\ , ``worker``\ , and ``job`` components. - - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "discount_percent": 0.0, # Optional. - "instance_sizes": [ - { - "bandwidth_allowance_gib": "str", # Optional. The bandwidth - allowance in GiB for the instance size. - "cpu_type": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * SHARED: Shared vCPU cores"n"n * DEDICATED: Dedicated - vCPU cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED". - "cpus": "str", # Optional. The number of allotted vCPU - cores. - "deprecation_intent": bool, # Optional. Indicates if the - instance size is intended for deprecation. - "memory_bytes": "str", # Optional. The allotted memory in - bytes. - "name": "str", # Optional. A human-readable name of the - instance size. - "scalable": bool, # Optional. Indicates if the instance size - can enable autoscaling. - "single_instance_only": bool, # Optional. Indicates if the - instance size allows more than one instance. - "slug": "str", # Optional. The slug of the instance size. - "tier_downgrade_to": "str", # Optional. The slug of the - corresponding downgradable instance size on the lower tier. - "tier_slug": "str", # Optional. The slug of the tier to - which this instance size belongs. - "tier_upgrade_to": "str", # Optional. The slug of the - corresponding upgradable instance size on the higher tier. - "usd_per_month": "str", # Optional. The cost of this - instance size in USD per month. - "usd_per_second": "str" # Optional. The cost of this - instance size in USD per second. - } - ] - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_list_instance_sizes_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def get_instance_size(self, slug: str, **kwargs: Any) -> JSON: - """Retrieve an Instance Size. - - Retrieve information about a specific instance size for ``service``\ , ``worker``\ , and - ``job`` components. - - :param slug: The slug of the instance size. Required. - :type slug: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { - "instance_size": { - "bandwidth_allowance_gib": "str", # Optional. The bandwidth - allowance in GiB for the instance size. - "cpu_type": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * SHARED: Shared vCPU cores"n"n * DEDICATED: Dedicated vCPU - cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED". - "cpus": "str", # Optional. The number of allotted vCPU cores. - "deprecation_intent": bool, # Optional. Indicates if the instance - size is intended for deprecation. - "memory_bytes": "str", # Optional. The allotted memory in bytes. - "name": "str", # Optional. A human-readable name of the instance - size. - "scalable": bool, # Optional. Indicates if the instance size can - enable autoscaling. - "single_instance_only": bool, # Optional. Indicates if the instance - size allows more than one instance. - "slug": "str", # Optional. The slug of the instance size. - "tier_downgrade_to": "str", # Optional. The slug of the - corresponding downgradable instance size on the lower tier. - "tier_slug": "str", # Optional. The slug of the tier to which this - instance size belongs. - "tier_upgrade_to": "str", # Optional. The slug of the corresponding - upgradable instance size on the higher tier. - "usd_per_month": "str", # Optional. The cost of this instance size - in USD per month. - "usd_per_second": "str" # Optional. The cost of this instance size - in USD per second. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. + "deployment": { + "cause": "str", # Optional. What caused this deployment to be + created. + "cloned_from": "str", # Optional. The ID of a previous deployment + that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The namespace where + the functions are deployed. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this functions + component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this job. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known + values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", + "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful steps. + "pending_steps": 0, # Optional. Number of pending steps. + "running_steps": 0, # Optional. Number of currently running + steps. + "steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful steps. + "summary_steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this service. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this static + site. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this static site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier slug of the + deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment + was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this worker. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this worker. + } + ] + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def create_deployment( + self, + app_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create an App Deployment. + + Creating an app deployment will pull the latest changes from your repository and schedule a new + deployment for your app. + + :param app_id: The app ID. Required. + :type app_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deployment": { + "cause": "str", # Optional. What caused this deployment to be + created. + "cloned_from": "str", # Optional. The ID of a previous deployment + that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The namespace where + the functions are deployed. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this functions + component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this job. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known + values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", + "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful steps. + "pending_steps": 0, # Optional. Number of pending steps. + "running_steps": 0, # Optional. Number of currently running + steps. + "steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful steps. + "summary_steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this service. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this static + site. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this static site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier slug of the + deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment + was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this worker. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this worker. + } + ] + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def create_deployment( + self, app_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create an App Deployment. + + Creating an app deployment will pull the latest changes from your repository and schedule a new + deployment for your app. + + :param app_id: The app ID. Required. + :type app_id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "force_build": bool # Optional. Indicates whether to force a build of app + from source even if an existing cached build is suitable for re-use. + } + + # response body for status code(s): 200 + response == { + "deployment": { + "cause": "str", # Optional. What caused this deployment to be + created. + "cloned_from": "str", # Optional. The ID of a previous deployment + that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The namespace where + the functions are deployed. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this functions + component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this job. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known + values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", + "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful steps. + "pending_steps": 0, # Optional. Number of pending steps. + "running_steps": 0, # Optional. Number of currently running + steps. + "steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful steps. + "summary_steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this service. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this static + site. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this static site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier slug of the + deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment + was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this worker. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this worker. + } + ] + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_apps_create_deployment_request( + app_id=app_id, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_deployment( + self, app_id: str, deployment_id: str, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve an App Deployment. + + Retrieve information about an app deployment. + + :param app_id: The app ID. Required. + :type app_id: str + :param deployment_id: The deployment ID. Required. + :type deployment_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deployment": { + "cause": "str", # Optional. What caused this deployment to be + created. + "cloned_from": "str", # Optional. The ID of a previous deployment + that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The namespace where + the functions are deployed. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this functions + component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this job. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known + values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", + "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful steps. + "pending_steps": 0, # Optional. Number of pending steps. + "running_steps": 0, # Optional. Number of currently running + steps. + "steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful steps. + "summary_steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this service. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this static + site. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this static site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier slug of the + deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment + was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this worker. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this worker. + } + ] + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_deployment_request( + app_id=app_id, + deployment_id=deployment_id, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def cancel_deployment( + self, app_id: str, deployment_id: str, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Cancel a Deployment. + + Immediately cancel an in-progress deployment. + + :param app_id: The app ID. Required. + :type app_id: str + :param deployment_id: The deployment ID. Required. + :type deployment_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deployment": { + "cause": "str", # Optional. What caused this deployment to be + created. + "cloned_from": "str", # Optional. The ID of a previous deployment + that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The namespace where + the functions are deployed. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this functions + component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this job. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known + values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", + "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful steps. + "pending_steps": 0, # Optional. Number of pending steps. + "running_steps": 0, # Optional. Number of currently running + steps. + "steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful steps. + "summary_steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this service. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this static + site. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this static site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier slug of the + deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment + was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this worker. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this worker. + } + ] + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_cancel_deployment_request( + app_id=app_id, + deployment_id=deployment_id, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_logs( + self, + app_id: str, + deployment_id: str, + component_name: str, + *, + follow: Optional[bool] = None, + type: str = "UNSPECIFIED", + pod_connection_timeout: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Deployment Logs. + + Retrieve the logs of a past, in-progress, or active deployment. The response will include links + to either real-time logs of an in-progress or active deployment or archived logs of a past + deployment. + + :param app_id: The app ID. Required. + :type app_id: str + :param deployment_id: The deployment ID. Required. + :type deployment_id: str + :param component_name: An optional component name. If set, logs will be limited to this + component only. Required. + :type component_name: str + :keyword follow: Whether the logs should follow live updates. Default value is None. + :paramtype follow: bool + :keyword type: The type of logs to retrieve + + + * BUILD: Build-time logs + * DEPLOY: Deploy-time logs + * RUN: Live run-time logs + * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: + "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". + :paramtype type: str + :keyword pod_connection_timeout: An optional time duration to wait if the underlying component + instance is not immediately available. Default: ``3m``. Default value is None. + :paramtype pod_connection_timeout: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "historic_urls": [ + "str" # Optional. A list of URLs to archived log files. + ], + "live_url": "str" # Optional. A URL of the real-time live logs. This URL may + use either the ``https://`` or ``wss://`` protocols and will keep pushing live + logs as they become available. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_logs_request( + app_id=app_id, + deployment_id=deployment_id, + component_name=component_name, + follow=follow, + type=type, + pod_connection_timeout=pod_connection_timeout, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_logs_aggregate( + self, + app_id: str, + deployment_id: str, + *, + follow: Optional[bool] = None, + type: str = "UNSPECIFIED", + pod_connection_timeout: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Aggregate Deployment Logs. + + Retrieve the logs of a past, in-progress, or active deployment. If a component name is + specified, the logs will be limited to only that component. The response will include links to + either real-time logs of an in-progress or active deployment or archived logs of a past + deployment. + + :param app_id: The app ID. Required. + :type app_id: str + :param deployment_id: The deployment ID. Required. + :type deployment_id: str + :keyword follow: Whether the logs should follow live updates. Default value is None. + :paramtype follow: bool + :keyword type: The type of logs to retrieve + + + * BUILD: Build-time logs + * DEPLOY: Deploy-time logs + * RUN: Live run-time logs + * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: + "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". + :paramtype type: str + :keyword pod_connection_timeout: An optional time duration to wait if the underlying component + instance is not immediately available. Default: ``3m``. Default value is None. + :paramtype pod_connection_timeout: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "historic_urls": [ + "str" # Optional. A list of URLs to archived log files. + ], + "live_url": "str" # Optional. A URL of the real-time live logs. This URL may + use either the ``https://`` or ``wss://`` protocols and will keep pushing live + logs as they become available. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_logs_aggregate_request( + app_id=app_id, + deployment_id=deployment_id, + follow=follow, + type=type, + pod_connection_timeout=pod_connection_timeout, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_logs_active_deployment_aggregate( + self, + app_id: str, + *, + follow: Optional[bool] = None, + type: str = "UNSPECIFIED", + pod_connection_timeout: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Active Deployment Aggregate Logs. + + Retrieve the logs of the active deployment if one exists. The response will include links to + either real-time logs of an in-progress or active deployment or archived logs of a past + deployment. Note log_type=BUILD logs will return logs associated with the current active + deployment (being served). To view build logs associated with in-progress build, the query must + explicitly reference the deployment id. + + :param app_id: The app ID. Required. + :type app_id: str + :keyword follow: Whether the logs should follow live updates. Default value is None. + :paramtype follow: bool + :keyword type: The type of logs to retrieve + + + * BUILD: Build-time logs + * DEPLOY: Deploy-time logs + * RUN: Live run-time logs + * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: + "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". + :paramtype type: str + :keyword pod_connection_timeout: An optional time duration to wait if the underlying component + instance is not immediately available. Default: ``3m``. Default value is None. + :paramtype pod_connection_timeout: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "historic_urls": [ + "str" # Optional. A list of URLs to archived log files. + ], + "live_url": "str" # Optional. A URL of the real-time live logs. This URL may + use either the ``https://`` or ``wss://`` protocols and will keep pushing live + logs as they become available. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_logs_active_deployment_aggregate_request( + app_id=app_id, + follow=follow, + type=type, + pod_connection_timeout=pod_connection_timeout, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_tiers(self, **kwargs: Any) -> JSON: + """List App Tiers. + + List all app tiers. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "tiers": [ + { + "build_seconds": "str", # Optional. The amount of included + build time in seconds. + "egress_bandwidth_bytes": "str", # Optional. The amount of + included outbound bandwidth in bytes. + "name": "str", # Optional. A human-readable name of the + tier. + "slug": "str", # Optional. The slug of the tier. + "storage_bytes": "str" # Optional. The allotted disk space + in bytes. + } + ] + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_list_tiers_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_tier(self, slug: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an App Tier. + + Retrieve information about a specific app tier. + + :param slug: The slug of the tier. Required. + :type slug: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "tier": { + "build_seconds": "str", # Optional. The amount of included build + time in seconds. + "egress_bandwidth_bytes": "str", # Optional. The amount of included + outbound bandwidth in bytes. + "name": "str", # Optional. A human-readable name of the tier. + "slug": "str", # Optional. The slug of the tier. + "storage_bytes": "str" # Optional. The allotted disk space in bytes. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_tier_request( + slug=slug, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_instance_sizes(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """List Instance Sizes. + + List all instance sizes for ``service``\\ , ``worker``\\ , and ``job`` components. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "discount_percent": 0.0, # Optional. + "instance_sizes": [ + { + "bandwidth_allowance_gib": "str", # Optional. The bandwidth + allowance in GiB for the instance size. + "cpu_type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * SHARED: Shared vCPU cores * DEDICATED: Dedicated vCPU + cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED". + "cpus": "str", # Optional. The number of allotted vCPU + cores. + "deprecation_intent": bool, # Optional. Indicates if the + instance size is intended for deprecation. + "memory_bytes": "str", # Optional. The allotted memory in + bytes. + "name": "str", # Optional. A human-readable name of the + instance size. + "scalable": bool, # Optional. Indicates if the instance size + can enable autoscaling. + "single_instance_only": bool, # Optional. Indicates if the + instance size allows more than one instance. + "slug": "str", # Optional. The slug of the instance size. + "tier_downgrade_to": "str", # Optional. The slug of the + corresponding downgradable instance size on the lower tier. + "tier_slug": "str", # Optional. The slug of the tier to + which this instance size belongs. + "tier_upgrade_to": "str", # Optional. The slug of the + corresponding upgradable instance size on the higher tier. + "usd_per_month": "str", # Optional. The cost of this + instance size in USD per month. + "usd_per_second": "str" # Optional. The cost of this + instance size in USD per second. + } + ] + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_list_instance_sizes_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_instance_size(self, slug: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an Instance Size. + + Retrieve information about a specific instance size for ``service``\\ , ``worker``\\ , and + ``job`` components. + + :param slug: The slug of the instance size. Required. + :type slug: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "instance_size": { + "bandwidth_allowance_gib": "str", # Optional. The bandwidth + allowance in GiB for the instance size. + "cpu_type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * SHARED: Shared vCPU cores * DEDICATED: Dedicated vCPU + cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED". + "cpus": "str", # Optional. The number of allotted vCPU cores. + "deprecation_intent": bool, # Optional. Indicates if the instance + size is intended for deprecation. + "memory_bytes": "str", # Optional. The allotted memory in bytes. + "name": "str", # Optional. A human-readable name of the instance + size. + "scalable": bool, # Optional. Indicates if the instance size can + enable autoscaling. + "single_instance_only": bool, # Optional. Indicates if the instance + size allows more than one instance. + "slug": "str", # Optional. The slug of the instance size. + "tier_downgrade_to": "str", # Optional. The slug of the + corresponding downgradable instance size on the lower tier. + "tier_slug": "str", # Optional. The slug of the tier to which this + instance size belongs. + "tier_upgrade_to": "str", # Optional. The slug of the corresponding + upgradable instance size on the higher tier. + "usd_per_month": "str", # Optional. The cost of this instance size + in USD per month. + "usd_per_second": "str" # Optional. The cost of this instance size + in USD per second. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_instance_size_request( + slug=slug, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_regions(self, **kwargs: Any) -> JSON: + """List App Regions. + + List all regions supported by App Platform. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "regions": [ + { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + } + ] + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_list_regions_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def validate_app_spec( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Propose an App Spec. + + To propose and validate a spec for a new or existing app, send a POST request to the + ``/v2/apps/propose`` endpoint. The request returns some information about the proposed app, + including app cost and upgrade cost. If an existing app ID is specified, the app spec is + treated as a proposed update to the existing app. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ + { + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of the + component to route to. Required. + "preserve_path_prefix": "str", # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for Functions + Components and is mutually exclusive with ``rewrite``. + "rewrite": "str" # Optional. An + optional field that will rewrite the path of the component to + be what is specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with ``path=/api`` will + have requests to ``/api/list`` trimmed to ``/list``. If you + specified the rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. Note: this + is mutually exclusive with ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # Optional. The + authority/host to redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # Optional. The port to + redirect to. + "redirect_code": 0, # Optional. The + redirect code to use. Defaults to ``302``. Supported values + are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. The + scheme to redirect to. Supported values are ``http`` or + ``https``. Default: ``https``. + "uri": "str" # Optional. An optional + URI path to redirect to. Note: if this is specified the whole + URI of the original request will be overwritten to this + value, irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a + component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the geographical + origin of the app. Default: ``nearest available``. Known values are: "ams", + "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. The + number of failed health checks before considered unhealthy. + "http_path": "str", # Optional. The route + path used for the HTTP health check ping. If not set, the HTTP + health check will be disabled and a TCP health check used + instead. + "initial_delay_seconds": 0, # Optional. The + number of seconds to wait before beginning health checks. + "period_seconds": 0, # Optional. The number + of seconds to wait between health checks. + "port": 0, # Optional. The port on which the + health check will be performed. If not set, the health check will + be performed on the component's http_port. + "success_threshold": 0, # Optional. The + number of successful health checks before considered healthy. + "timeout_seconds": 0 # Optional. The number + of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal port on + which this service's run command will listen. Default: 8080 If there + is not an environment variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which this + service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, # Optional. The number + of seconds to wait between selecting a container instance for + termination and issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain of new + requests on upstream load-balancers. (Default 15). + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "catchall_document": "str", # Optional. The name of + the document to use as the fallback for any requests to documents + that are not found when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. Default + value is "404.html". The name of the error document to use when + serving this static site. Default: 404.html. If no such file exists + within the built assets, App Platform will supply one. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "index_document": "index.html", # Optional. Default + value is "index.html". The name of the index document to use when + serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "output_dir": "str", # Optional. An optional path to + where the built assets will be located, relative to the build + context. If not set, App Platform will automatically scan for these + directory names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ] + }, + "app_id": "str" # Optional. An optional ID of an existing app. If set, the + spec will be treated as a proposed update to the specified app. The existing app + is not modified using this method. } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_instance_size_request( - slug=slug, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def list_regions(self, **kwargs: Any) -> JSON: - """List App Regions. - - List all regions supported by App Platform. - - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { - "regions": [ - { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - } - ] - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_list_regions_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @overload - async def validate_app_spec( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Propose an App Spec. - - To propose and validate a spec for a new or existing app, send a POST request to the - ``/v2/apps/propose`` endpoint. The request returns some information about the proposed app, - including app cost and upgrade cost. If an existing app ID is specified, the app spec is - treated as a proposed update to the existing app. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "app_id": "str", # Optional. An optional ID of an existing app. If set, the - spec will be treated as a proposed update to the specified app. The existing app - is not modified using this method. + "app_cost": 0, # Optional. The monthly cost of the proposed app in USD. + "app_is_static": bool, # Optional. Indicates whether the app is a static + app. + "app_name_available": bool, # Optional. Indicates whether the app name is + available. + "app_name_suggestion": "str", # Optional. The suggested name if the proposed + app name is unavailable. + "app_tier_downgrade_cost": 0, # Optional. The monthly cost of the proposed + app in USD using the previous pricing plan tier. For example, if you propose an + app that uses the Professional tier, the ``app_tier_downgrade_cost`` field + displays the monthly cost of the app if it were to use the Basic tier. If the + proposed app already uses the lest expensive tier, the field is empty. + "existing_static_apps": "str", # Optional. The maximum number of free static + apps the account can have. We will charge you for any additional static apps. "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, @@ -67961,10 +71555,8 @@ async def validate_app_spec( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of the @@ -67982,19 +71574,19 @@ async def validate_app_spec( "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that + assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A + live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -68004,6 +71596,8 @@ async def validate_app_spec( }, "functions": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "alerts": [ { "disabled": bool, # Optional. Is the @@ -68077,15 +71671,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -68118,6 +71711,7 @@ async def validate_app_spec( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -68128,18 +71722,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -68149,8 +71742,6 @@ async def validate_app_spec( syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -68302,15 +71893,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -68356,12 +71946,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -68384,12 +71974,13 @@ async def validate_app_spec( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -68400,18 +71991,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -68437,8 +72027,6 @@ async def validate_app_spec( } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -68516,15 +72104,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -68576,7 +72163,7 @@ async def validate_app_spec( of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -68593,12 +72180,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -68624,6 +72211,7 @@ async def validate_app_spec( service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -68634,18 +72222,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -68755,15 +72342,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -68813,12 +72399,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -68832,6 +72418,7 @@ async def validate_app_spec( value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -68842,18 +72429,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -68927,15 +72513,317 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ] + } + } + """ + + @overload + async def validate_app_spec( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Propose an App Spec. + + To propose and validate a spec for a new or existing app, send a POST request to the + ``/v2/apps/propose`` endpoint. The request returns some information about the proposed app, + including app cost and upgrade cost. If an existing app ID is specified, the app spec is + treated as a proposed update to the existing app. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "app_cost": 0, # Optional. The monthly cost of the proposed app in USD. + "app_is_static": bool, # Optional. Indicates whether the app is a static + app. + "app_name_available": bool, # Optional. Indicates whether the app name is + available. + "app_name_suggestion": "str", # Optional. The suggested name if the proposed + app name is unavailable. + "app_tier_downgrade_cost": 0, # Optional. The monthly cost of the proposed + app in USD using the previous pricing plan tier. For example, if you propose an + app that uses the Professional tier, the ``app_tier_downgrade_cost`` field + displays the monthly cost of the app if it were to use the Basic tier. If the + proposed app already uses the lest expensive tier, the field is empty. + "existing_static_apps": "str", # Optional. The maximum number of free static + apps the account can have. We will charge you for any additional static apps. + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ + { + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -68967,47 +72855,8 @@ async def validate_app_spec( repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. - }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "instance_count": 1, # Optional. Default value is 1. - The amount of instances that this component should be scaled to. - Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", # - Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to - use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -69018,253 +72867,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. - }, "endpoint": "str", # OpenSearch API Endpoint. Only HTTPS is supported. Format: :code:``::code:``. Default port is 9300. Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". - }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str", # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The - number of seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate shutdown. - (Default 120). - } - } - ] - } - } - - # response body for status code(s): 200 - response == { - "app_cost": 0, # Optional. The monthly cost of the proposed app in USD. - "app_is_static": bool, # Optional. Indicates whether the app is a static - app. - "app_name_available": bool, # Optional. Indicates whether the app name is - available. - "app_name_suggestion": "str", # Optional. The suggested name if the proposed - app name is unavailable. - "app_tier_downgrade_cost": 0, # Optional. The monthly cost of the proposed - app in USD using the previous pricing plan tier. For example, if you propose an - app that uses the Professional tier, the ``app_tier_downgrade_cost`` field - displays the monthly cost of the app if it were to use the Basic tier. If the - proposed app already uses the lest expensive tier, the field is empty. - "existing_static_apps": "str", # Optional. The maximum number of free static - apps the account can have. We will charge you for any additional static apps. - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name of the - underlying DigitalOcean DBaaS cluster. This is required for - production databases. For dev databases, if cluster_name is not set, - a new cluster will be provisioned. - "db_name": "str", # Optional. The name of the MySQL - or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of the MySQL - or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. - "production": bool, # Optional. Whether this is a - production or dev database. - "version": "str" # Optional. The version of the - database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the domain. - Required. - "minimum_tls_version": "str", # Optional. The - minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: - "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that - is displayed as the default in the control panel, used in bindable - environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A - non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", - "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. Indicates whether the - domain includes all sub-domains, in addition to the given domain. - "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # Optional. Is the - alert disabled?. - "operator": "UNSPECIFIED_OPERATOR", - # Optional. Default value is "UNSPECIFIED_OPERATOR". Known - values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": "UNSPECIFIED_RULE", # - Optional. Default value is "UNSPECIFIED_RULE". Known values - are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. Threshold - value for alert. - "window": "UNSPECIFIED_WINDOW" # - Optional. Default value is "UNSPECIFIED_WINDOW". Known values - are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # Optional. - Whether browsers should expose the response to the client-side - JavaScript code when the request"u2019s credentials mode is - include. This configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # Optional. The set of allowed - HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of allowed - HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. - Exact string match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "regex": "str" # Optional. - RE2 style regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For more - information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of HTTP - response headers that browsers are allowed to access. This - configures the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An optional - duration specifying how long browsers can cache the results of a - preflight request. This configures the ``Access-Control-Max-Age`` - header. - }, - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -69274,8 +72887,6 @@ async def validate_app_spec( syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -69427,15 +73038,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -69481,12 +73091,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -69509,12 +73119,13 @@ async def validate_app_spec( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -69525,18 +73136,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -69562,8 +73172,6 @@ async def validate_app_spec( } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -69641,15 +73249,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -69701,7 +73308,7 @@ async def validate_app_spec( of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -69718,12 +73325,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -69749,6 +73356,7 @@ async def validate_app_spec( service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -69759,18 +73367,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -69880,15 +73487,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -69938,12 +73544,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -69957,6 +73563,7 @@ async def validate_app_spec( value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -69967,18 +73574,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -70052,15 +73658,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -70106,12 +73711,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -70133,6 +73738,7 @@ async def validate_app_spec( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -70143,18 +73749,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -70184,10 +73789,11 @@ async def validate_app_spec( } """ - @overload + @distributed_trace_async async def validate_app_spec( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Propose an App Spec. To propose and validate a spec for a new or existing app, send a POST request to the @@ -70195,11 +73801,8 @@ async def validate_app_spec( including app cost and upgrade cost. If an existing app ID is specified, the app spec is treated as a proposed update to the existing app. - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -70207,25 +73810,15 @@ async def validate_app_spec( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "app_cost": 0, # Optional. The monthly cost of the proposed app in USD. - "app_is_static": bool, # Optional. Indicates whether the app is a static - app. - "app_name_available": bool, # Optional. Indicates whether the app name is - available. - "app_name_suggestion": "str", # Optional. The suggested name if the proposed - app name is unavailable. - "app_tier_downgrade_cost": 0, # Optional. The monthly cost of the proposed - app in USD using the previous pricing plan tier. For example, if you propose an - app that uses the Professional tier, the ``app_tier_downgrade_cost`` field - displays the monthly cost of the app if it were to use the Basic tier. If the - proposed app already uses the lest expensive tier, the field is empty. - "existing_static_apps": "str", # Optional. The maximum number of free static - apps the account can have. We will charge you for any additional static apps. + # JSON input template you can fill out and use as your body input. + body = { "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, @@ -70235,10 +73828,8 @@ async def validate_app_spec( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of the @@ -70256,19 +73847,19 @@ async def validate_app_spec( "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that + assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A + live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -70278,6 +73869,8 @@ async def validate_app_spec( }, "functions": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "alerts": [ { "disabled": bool, # Optional. Is the @@ -70351,15 +73944,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -70392,6 +73984,7 @@ async def validate_app_spec( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -70402,18 +73995,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -70423,8 +74015,6 @@ async def validate_app_spec( syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -70576,15 +74166,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -70630,12 +74219,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -70658,12 +74247,13 @@ async def validate_app_spec( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -70674,18 +74264,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -70711,8 +74300,6 @@ async def validate_app_spec( } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -70790,15 +74377,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -70850,7 +74436,7 @@ async def validate_app_spec( of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -70867,12 +74453,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -70898,6 +74484,7 @@ async def validate_app_spec( service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -70908,18 +74495,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -71029,15 +74615,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -71087,12 +74672,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -71106,6 +74691,7 @@ async def validate_app_spec( value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -71116,18 +74702,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -71201,15 +74786,14 @@ async def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -71255,12 +74839,12 @@ async def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -71282,6 +74866,7 @@ async def validate_app_spec( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -71292,18 +74877,17 @@ async def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -71329,30 +74913,11 @@ async def validate_app_spec( } } ] - } + }, + "app_id": "str" # Optional. An optional ID of an existing app. If set, the + spec will be treated as a proposed update to the specified app. The existing app + is not modified using this method. } - """ - - @distributed_trace_async - async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Propose an App Spec. - - To propose and validate a spec for a new or existing app, send a POST request to the - ``/v2/apps/propose`` endpoint. The request returns some information about the proposed app, - including app cost and upgrade cost. If an existing app ID is specified, the app spec is - treated as a proposed update to the existing app. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { @@ -71371,8 +74936,12 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "existing_static_apps": "str", # Optional. The maximum number of free static apps the account can have. We will charge you for any additional static apps. "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, @@ -71382,10 +74951,8 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of the @@ -71403,19 +74970,19 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that + assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A + live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -71425,6 +74992,8 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "alerts": [ { "disabled": bool, # Optional. Is the @@ -71498,15 +75067,14 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -71539,6 +75107,7 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -71549,18 +75118,17 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -71570,8 +75138,6 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -71723,15 +75289,14 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -71777,12 +75342,12 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -71805,12 +75370,13 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -71821,18 +75387,17 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -71858,8 +75423,6 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -71937,15 +75500,14 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -71997,7 +75559,7 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -72014,12 +75576,12 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -72045,6 +75607,7 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -72055,18 +75618,17 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -72176,15 +75738,14 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -72234,12 +75795,12 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -72253,6 +75814,7 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -72263,18 +75825,17 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -72348,15 +75909,14 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -72402,12 +75962,12 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -72429,6 +75989,7 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -72439,18 +76000,17 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -72479,10 +76039,14 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -72491,38 +76055,41 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_validate_app_spec_request( + _request = build_apps_validate_app_spec_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -72542,12 +76109,13 @@ async def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List all app alerts. List alerts associated to the app and any components. This includes configuration information @@ -72640,10 +76208,14 @@ async def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -72652,25 +76224,28 @@ async def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_list_alerts_request( + _request = build_apps_list_alerts_request( app_id=app_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -72707,9 +76282,9 @@ async def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def assign_alert_destinations( @@ -72721,6 +76296,7 @@ async def assign_alert_destinations( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update destinations for alerts. Updates the emails and slack webhook destinations for app alerts. Emails must be associated to @@ -72833,11 +76409,12 @@ async def assign_alert_destinations( self, app_id: str, alert_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update destinations for alerts. Updates the emails and slack webhook destinations for app alerts. Emails must be associated to @@ -72848,7 +76425,7 @@ async def assign_alert_destinations( :param alert_id: The alert ID. Required. :type alert_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -72933,8 +76510,9 @@ async def assign_alert_destinations( @distributed_trace_async async def assign_alert_destinations( - self, app_id: str, alert_id: str, body: Union[JSON, IO], **kwargs: Any + self, app_id: str, alert_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update destinations for alerts. Updates the emails and slack webhook destinations for app alerts. Emails must be associated to @@ -72944,11 +76522,8 @@ async def assign_alert_destinations( :type app_id: str :param alert_id: The alert ID. Required. :type alert_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -72956,6 +76531,20 @@ async def assign_alert_destinations( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "emails": [ + "" # Optional. Default value is "". + ], + "slack_webhooks": [ + { + "channel": "str", # Optional. Name of the Slack Webhook + Channel. + "url": "str" # Optional. URL of the Slack webhook. + } + ] + } + # response body for status code(s): 200 response == { "alert": { @@ -73027,10 +76616,14 @@ async def assign_alert_destinations( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -73039,20 +76632,20 @@ async def assign_alert_destinations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_assign_alert_destinations_request( + _request = build_apps_assign_alert_destinations_request( app_id=app_id, alert_id=alert_id, content_type=content_type, @@ -73061,18 +76654,21 @@ async def assign_alert_destinations( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -73109,9 +76705,9 @@ async def assign_alert_destinations( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_rollback( @@ -73122,6 +76718,7 @@ async def create_rollback( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Rollback App. Rollback an app to a previous deployment. A new deployment will be created to perform the @@ -73206,9 +76803,8 @@ async def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -73237,9 +76833,8 @@ async def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -73269,8 +76864,12 @@ async def create_rollback( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -73280,10 +76879,8 @@ async def create_rollback( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -73301,21 +76898,21 @@ async def create_rollback( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -73326,6 +76923,8 @@ async def create_rollback( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -73403,13 +77002,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -73444,6 +77043,7 @@ async def create_rollback( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -73454,18 +77054,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -73476,8 +77075,6 @@ async def create_rollback( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -73638,13 +77235,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -73693,13 +77290,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -73722,13 +77319,14 @@ async def create_rollback( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -73739,18 +77337,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -73777,8 +77374,6 @@ async def create_rollback( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -73860,13 +77455,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -73924,7 +77519,7 @@ async def create_rollback( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -73942,13 +77537,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -73974,6 +77569,7 @@ async def create_rollback( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -73984,18 +77580,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -74110,13 +77705,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -74170,13 +77765,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -74190,6 +77785,7 @@ async def create_rollback( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -74200,18 +77796,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -74288,13 +77883,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -74343,13 +77938,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -74371,6 +77966,7 @@ async def create_rollback( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -74381,18 +77977,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -74458,11 +78053,12 @@ async def create_rollback( async def create_rollback( self, app_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Rollback App. Rollback an app to a previous deployment. A new deployment will be created to perform the @@ -74479,7 +78075,7 @@ async def create_rollback( :param app_id: The app ID. Required. :type app_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -74536,9 +78132,8 @@ async def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -74567,9 +78162,8 @@ async def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -74599,8 +78193,12 @@ async def create_rollback( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -74610,10 +78208,8 @@ async def create_rollback( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -74631,21 +78227,21 @@ async def create_rollback( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -74656,6 +78252,8 @@ async def create_rollback( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -74733,13 +78331,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -74774,6 +78372,7 @@ async def create_rollback( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -74784,18 +78383,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -74806,8 +78404,6 @@ async def create_rollback( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -74968,13 +78564,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -75023,13 +78619,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -75052,13 +78648,14 @@ async def create_rollback( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75069,18 +78666,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -75107,8 +78703,6 @@ async def create_rollback( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -75190,13 +78784,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -75254,7 +78848,7 @@ async def create_rollback( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -75272,13 +78866,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -75304,6 +78898,7 @@ async def create_rollback( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75314,18 +78909,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -75440,13 +79034,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -75500,13 +79094,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -75520,6 +79114,7 @@ async def create_rollback( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75530,18 +79125,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -75618,13 +79212,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -75673,13 +79267,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -75701,6 +79295,7 @@ async def create_rollback( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75711,18 +79306,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -75786,8 +79380,9 @@ async def create_rollback( @distributed_trace_async async def create_rollback( - self, app_id: str, body: Union[JSON, IO], **kwargs: Any + self, app_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Rollback App. Rollback an app to a previous deployment. A new deployment will be created to perform the @@ -75803,11 +79398,8 @@ async def create_rollback( :param app_id: The app ID. Required. :type app_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -75815,6 +79407,17 @@ async def create_rollback( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "deployment_id": "str", # Optional. The ID of the deployment to rollback to. + "skip_pin": bool # Optional. Whether to skip pinning the rollback + deployment. If false, the rollback deployment will be pinned and any new + deployments including Auto Deploy on Push hooks will be disabled until the + rollback is either manually committed or reverted via the CommitAppRollback or + RevertAppRollback endpoints respectively. If true, the rollback will be + immediately committed and the app will remain unpinned. + } + # response body for status code(s): 200 response == { "deployment": { @@ -75861,9 +79464,8 @@ async def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -75892,9 +79494,8 @@ async def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -75924,8 +79525,12 @@ async def create_rollback( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -75935,10 +79540,8 @@ async def create_rollback( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -75956,21 +79559,21 @@ async def create_rollback( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -75981,6 +79584,8 @@ async def create_rollback( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -76058,13 +79663,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -76099,6 +79704,7 @@ async def create_rollback( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -76109,18 +79715,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -76131,8 +79736,6 @@ async def create_rollback( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -76293,13 +79896,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -76348,13 +79951,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -76377,13 +79980,14 @@ async def create_rollback( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -76394,18 +79998,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -76432,8 +80035,6 @@ async def create_rollback( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -76515,13 +80116,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -76579,7 +80180,7 @@ async def create_rollback( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -76597,13 +80198,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -76629,6 +80230,7 @@ async def create_rollback( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -76639,18 +80241,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -76765,13 +80366,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -76825,13 +80426,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -76845,6 +80446,7 @@ async def create_rollback( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -76855,18 +80457,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -76943,13 +80544,13 @@ async def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -76998,13 +80599,13 @@ async def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -77026,6 +80627,7 @@ async def create_rollback( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -77036,18 +80638,17 @@ async def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -77108,10 +80709,14 @@ async def create_rollback( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -77120,20 +80725,20 @@ async def create_rollback( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_create_rollback_request( + _request = build_apps_create_rollback_request( app_id=app_id, content_type=content_type, json=_json, @@ -77141,18 +80746,21 @@ async def create_rollback( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -77189,9 +80797,9 @@ async def create_rollback( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def validate_rollback( @@ -77202,6 +80810,7 @@ async def validate_rollback( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Validate App Rollback. Check whether an app can be rolled back to a specific deployment. This endpoint can also be @@ -77241,23 +80850,23 @@ async def validate_rollback( response == { "error": { "code": "str", # Optional. A code identifier that represents the - failing condition."n"nFailing conditions:"n"n"n* ``incompatible_phase`` - - indicates that the deployment's phase is not suitable for rollback."n* + failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * ``incompatible_result`` - indicates that the deployment's result is not - suitable for rollback."n* ``exceeded_revision_limit`` - indicates that the - app has exceeded the rollback revision limits for its tier."n* ``app_pinned`` - - indicates that there is already a rollback in progress and the app is - pinned."n* ``database_config_conflict`` - indicates that the deployment's - database config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that the - deployment contains at least one component with an image source that is - missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the app + has exceeded the rollback revision limits for its tier. * ``app_pinned`` - + indicates that there is already a rollback in progress and the app is pinned. + * ``database_config_conflict`` - indicates that the deployment's database + config is different than the current config. * ``region_conflict`` - + indicates that the deployment's region differs from the current app region. + Warning conditions: * ``static_site_requires_rebuild`` - indicates that the + deployment contains at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains at + least one component with an image source that is missing a digest. Known + values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. ], @@ -77269,24 +80878,24 @@ async def validate_rollback( "warnings": [ { "code": "str", # Optional. A code identifier that represents - the failing condition."n"nFailing conditions:"n"n"n* - ``incompatible_phase`` - indicates that the deployment's phase is not - suitable for rollback."n* ``incompatible_result`` - indicates that the - deployment's result is not suitable for rollback."n* - ``exceeded_revision_limit`` - indicates that the app has exceeded the - rollback revision limits for its tier."n* ``app_pinned`` - indicates that - there is already a rollback in progress and the app is pinned."n* - ``database_config_conflict`` - indicates that the deployment's database - config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that - the deployment contains at least one component with an image source that - is missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + the failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * + ``incompatible_result`` - indicates that the deployment's result is not + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the + app has exceeded the rollback revision limits for its tier. * + ``app_pinned`` - indicates that there is already a rollback in progress + and the app is pinned. * ``database_config_conflict`` - indicates that + the deployment's database config is different than the current config. * + ``region_conflict`` - indicates that the deployment's region differs from + the current app region. Warning conditions: * + ``static_site_requires_rebuild`` - indicates that the deployment contains + at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains + at least one component with an image source that is missing a digest. + Known values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. Contains a list of warnings that may cause the rollback to run under unideal circumstances. @@ -77313,11 +80922,12 @@ async def validate_rollback( async def validate_rollback( self, app_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Validate App Rollback. Check whether an app can be rolled back to a specific deployment. This endpoint can also be @@ -77331,7 +80941,7 @@ async def validate_rollback( :param app_id: The app ID. Required. :type app_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -77346,23 +80956,23 @@ async def validate_rollback( response == { "error": { "code": "str", # Optional. A code identifier that represents the - failing condition."n"nFailing conditions:"n"n"n* ``incompatible_phase`` - - indicates that the deployment's phase is not suitable for rollback."n* + failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * ``incompatible_result`` - indicates that the deployment's result is not - suitable for rollback."n* ``exceeded_revision_limit`` - indicates that the - app has exceeded the rollback revision limits for its tier."n* ``app_pinned`` - - indicates that there is already a rollback in progress and the app is - pinned."n* ``database_config_conflict`` - indicates that the deployment's - database config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that the - deployment contains at least one component with an image source that is - missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the app + has exceeded the rollback revision limits for its tier. * ``app_pinned`` - + indicates that there is already a rollback in progress and the app is pinned. + * ``database_config_conflict`` - indicates that the deployment's database + config is different than the current config. * ``region_conflict`` - + indicates that the deployment's region differs from the current app region. + Warning conditions: * ``static_site_requires_rebuild`` - indicates that the + deployment contains at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains at + least one component with an image source that is missing a digest. Known + values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. ], @@ -77374,24 +80984,24 @@ async def validate_rollback( "warnings": [ { "code": "str", # Optional. A code identifier that represents - the failing condition."n"nFailing conditions:"n"n"n* - ``incompatible_phase`` - indicates that the deployment's phase is not - suitable for rollback."n* ``incompatible_result`` - indicates that the - deployment's result is not suitable for rollback."n* - ``exceeded_revision_limit`` - indicates that the app has exceeded the - rollback revision limits for its tier."n* ``app_pinned`` - indicates that - there is already a rollback in progress and the app is pinned."n* - ``database_config_conflict`` - indicates that the deployment's database - config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that - the deployment contains at least one component with an image source that - is missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + the failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * + ``incompatible_result`` - indicates that the deployment's result is not + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the + app has exceeded the rollback revision limits for its tier. * + ``app_pinned`` - indicates that there is already a rollback in progress + and the app is pinned. * ``database_config_conflict`` - indicates that + the deployment's database config is different than the current config. * + ``region_conflict`` - indicates that the deployment's region differs from + the current app region. Warning conditions: * + ``static_site_requires_rebuild`` - indicates that the deployment contains + at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains + at least one component with an image source that is missing a digest. + Known values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. Contains a list of warnings that may cause the rollback to run under unideal circumstances. @@ -77416,8 +81026,9 @@ async def validate_rollback( @distributed_trace_async async def validate_rollback( - self, app_id: str, body: Union[JSON, IO], **kwargs: Any + self, app_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Validate App Rollback. Check whether an app can be rolled back to a specific deployment. This endpoint can also be @@ -77430,11 +81041,8 @@ async def validate_rollback( :param app_id: The app ID. Required. :type app_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -77442,27 +81050,38 @@ async def validate_rollback( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "deployment_id": "str", # Optional. The ID of the deployment to rollback to. + "skip_pin": bool # Optional. Whether to skip pinning the rollback + deployment. If false, the rollback deployment will be pinned and any new + deployments including Auto Deploy on Push hooks will be disabled until the + rollback is either manually committed or reverted via the CommitAppRollback or + RevertAppRollback endpoints respectively. If true, the rollback will be + immediately committed and the app will remain unpinned. + } + # response body for status code(s): 200 response == { "error": { "code": "str", # Optional. A code identifier that represents the - failing condition."n"nFailing conditions:"n"n"n* ``incompatible_phase`` - - indicates that the deployment's phase is not suitable for rollback."n* + failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * ``incompatible_result`` - indicates that the deployment's result is not - suitable for rollback."n* ``exceeded_revision_limit`` - indicates that the - app has exceeded the rollback revision limits for its tier."n* ``app_pinned`` - - indicates that there is already a rollback in progress and the app is - pinned."n* ``database_config_conflict`` - indicates that the deployment's - database config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that the - deployment contains at least one component with an image source that is - missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the app + has exceeded the rollback revision limits for its tier. * ``app_pinned`` - + indicates that there is already a rollback in progress and the app is pinned. + * ``database_config_conflict`` - indicates that the deployment's database + config is different than the current config. * ``region_conflict`` - + indicates that the deployment's region differs from the current app region. + Warning conditions: * ``static_site_requires_rebuild`` - indicates that the + deployment contains at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains at + least one component with an image source that is missing a digest. Known + values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. ], @@ -77474,24 +81093,24 @@ async def validate_rollback( "warnings": [ { "code": "str", # Optional. A code identifier that represents - the failing condition."n"nFailing conditions:"n"n"n* - ``incompatible_phase`` - indicates that the deployment's phase is not - suitable for rollback."n* ``incompatible_result`` - indicates that the - deployment's result is not suitable for rollback."n* - ``exceeded_revision_limit`` - indicates that the app has exceeded the - rollback revision limits for its tier."n* ``app_pinned`` - indicates that - there is already a rollback in progress and the app is pinned."n* - ``database_config_conflict`` - indicates that the deployment's database - config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that - the deployment contains at least one component with an image source that - is missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + the failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * + ``incompatible_result`` - indicates that the deployment's result is not + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the + app has exceeded the rollback revision limits for its tier. * + ``app_pinned`` - indicates that there is already a rollback in progress + and the app is pinned. * ``database_config_conflict`` - indicates that + the deployment's database config is different than the current config. * + ``region_conflict`` - indicates that the deployment's region differs from + the current app region. Warning conditions: * + ``static_site_requires_rebuild`` - indicates that the deployment contains + at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains + at least one component with an image source that is missing a digest. + Known values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. Contains a list of warnings that may cause the rollback to run under unideal circumstances. @@ -77513,10 +81132,14 @@ async def validate_rollback( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -77525,20 +81148,20 @@ async def validate_rollback( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_validate_rollback_request( + _request = build_apps_validate_rollback_request( app_id=app_id, content_type=content_type, json=_json, @@ -77546,18 +81169,21 @@ async def validate_rollback( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -77594,12 +81220,13 @@ async def validate_rollback( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def commit_rollback(self, app_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Commit App Rollback. Commit an app rollback. This action permanently applies the rollback and unpins the app to @@ -77626,10 +81253,14 @@ async def commit_rollback(self, app_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -77638,25 +81269,28 @@ async def commit_rollback(self, app_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_apps_commit_rollback_request( + _request = build_apps_commit_rollback_request( app_id=app_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -77689,12 +81323,13 @@ async def commit_rollback(self, app_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Revert App Rollback. Revert an app rollback. This action reverts the active rollback by creating a new deployment @@ -77756,9 +81391,8 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -77787,9 +81421,8 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -77819,8 +81452,12 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -77830,10 +81467,8 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -77851,21 +81486,21 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -77876,6 +81511,8 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -77953,13 +81590,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -77994,6 +81631,7 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78004,18 +81642,17 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -78026,8 +81663,6 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -78188,13 +81823,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -78243,13 +81878,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -78272,13 +81907,14 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78289,18 +81925,17 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -78327,8 +81962,6 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -78410,13 +82043,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -78474,7 +82107,7 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -78492,13 +82125,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -78524,6 +82157,7 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78534,18 +82168,17 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -78660,13 +82293,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -78720,13 +82353,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -78740,6 +82373,7 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78750,18 +82384,17 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -78838,13 +82471,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -78893,13 +82526,13 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -78921,6 +82554,7 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78931,18 +82565,17 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -79003,10 +82636,14 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -79015,25 +82652,28 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_revert_rollback_request( + _request = build_apps_revert_rollback_request( app_id=app_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -79070,14 +82710,15 @@ async def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_metrics_bandwidth_daily( self, app_id: str, *, date: Optional[datetime.datetime] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve App Daily Bandwidth Metrics. Retrieve daily bandwidth usage metrics for a single app. @@ -79117,10 +82758,14 @@ async def get_metrics_bandwidth_daily( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -79129,26 +82774,29 @@ async def get_metrics_bandwidth_daily( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_get_metrics_bandwidth_daily_request( + _request = build_apps_get_metrics_bandwidth_daily_request( app_id=app_id, date=date, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -79185,14 +82833,15 @@ async def get_metrics_bandwidth_daily( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def list_metrics_bandwidth_daily( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Multiple Apps' Daily Bandwidth Metrics. Retrieve daily bandwidth usage metrics for multiple apps. @@ -79244,14 +82893,15 @@ async def list_metrics_bandwidth_daily( @overload async def list_metrics_bandwidth_daily( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Multiple Apps' Daily Bandwidth Metrics. Retrieve daily bandwidth usage metrics for multiple apps. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -79288,17 +82938,15 @@ async def list_metrics_bandwidth_daily( @distributed_trace_async async def list_metrics_bandwidth_daily( - self, body: Union[JSON, IO], **kwargs: Any + self, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Multiple Apps' Daily Bandwidth Metrics. Retrieve daily bandwidth usage metrics for multiple apps. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -79306,6 +82954,15 @@ async def list_metrics_bandwidth_daily( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "app_ids": [ + "str" # A list of app IDs to query bandwidth metrics for. Required. + ], + "date": "2020-02-20 00:00:00" # Optional. Optional day to query. Only the + date component of the timestamp will be considered. Default: yesterday. + } + # response body for status code(s): 200 response == { "app_bandwidth_usage": [ @@ -79329,10 +82986,14 @@ async def list_metrics_bandwidth_daily( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -79341,38 +83002,41 @@ async def list_metrics_bandwidth_daily( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_list_metrics_bandwidth_daily_request( + _request = build_apps_list_metrics_bandwidth_daily_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -79409,9 +83073,9 @@ async def list_metrics_bandwidth_daily( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class CdnOperations: @@ -79437,6 +83101,7 @@ def __init__(self, *args, **kwargs) -> None: async def list_endpoints( self, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All CDN Endpoints. To list all of the CDN endpoints available on your account, send a GET request to @@ -79455,8 +83120,14 @@ async def list_endpoints( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "endpoints": [ { + "origin": "str", # The fully qualified domain name (FQDN) + for the origin server which provides the content for the CDN. This is + currently restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. @@ -79469,9 +83140,6 @@ async def list_endpoints( name (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) - for the origin server which provides the content for the CDN. This is - currently restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) @@ -79480,16 +83148,17 @@ async def list_endpoints( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -79498,26 +83167,29 @@ async def list_endpoints( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_cdn_list_endpoints_request( + _request = build_cdn_list_endpoints_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -79537,14 +83209,15 @@ async def list_endpoints( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_endpoint( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New CDN Endpoint. To create a new CDN endpoint, send a POST request to ``/v2/cdn/endpoints``. The @@ -79569,6 +83242,9 @@ async def create_endpoint( # JSON input template you can fill out and use as your body input. body = { + "origin": "str", # The fully qualified domain name (FQDN) for the origin + server which provides the content for the CDN. This is currently restricted to a + Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given in @@ -79580,9 +83256,6 @@ async def create_endpoint( which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the origin - server which provides the content for the CDN. This is currently restricted to a - Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded. Known @@ -79592,6 +83265,9 @@ async def create_endpoint( # response body for status code(s): 201 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -79603,9 +83279,6 @@ async def create_endpoint( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -79616,8 +83289,9 @@ async def create_endpoint( @overload async def create_endpoint( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New CDN Endpoint. To create a new CDN endpoint, send a POST request to ``/v2/cdn/endpoints``. The @@ -79629,7 +83303,7 @@ async def create_endpoint( ``certificate_id`` attributes. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -79643,6 +83317,9 @@ async def create_endpoint( # response body for status code(s): 201 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -79654,9 +83331,6 @@ async def create_endpoint( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -79666,7 +83340,10 @@ async def create_endpoint( """ @distributed_trace_async - async def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create_endpoint( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Create a New CDN Endpoint. To create a new CDN endpoint, send a POST request to ``/v2/cdn/endpoints``. The @@ -79677,11 +83354,8 @@ async def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: A custom subdomain may be configured by specifying the ``custom_domain`` and ``certificate_id`` attributes. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -79689,9 +83363,34 @@ async def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "origin": "str", # The fully qualified domain name (FQDN) for the origin + server which provides the content for the CDN. This is currently restricted to a + Space. Required. + "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS + certificate used for SSL when a custom subdomain is provided. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the CDN endpoint was + created. + "custom_domain": "str", # Optional. The fully qualified domain name (FQDN) + of the custom subdomain used with the CDN endpoint. + "endpoint": "str", # Optional. The fully qualified domain name (FQDN) from + which the CDN-backed content is served. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a CDN endpoint. + "ttl": 3600 # Optional. Default value is 3600. The amount of time the + content is cached by the CDN's edge servers in seconds. TTL must be one of 60, + 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded. Known + values are: 60, 600, 3600, 86400, and 604800. + } + # response body for status code(s): 201 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -79703,9 +83402,6 @@ async def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -79713,10 +83409,14 @@ async def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -79725,38 +83425,41 @@ async def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_cdn_create_endpoint_request( + _request = build_cdn_create_endpoint_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -79776,12 +83479,13 @@ async def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing CDN Endpoint. To show information about an existing CDN endpoint, send a GET request to @@ -79799,6 +83503,9 @@ async def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -79810,9 +83517,6 @@ async def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -79831,10 +83535,14 @@ async def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -79843,25 +83551,28 @@ async def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_cdn_get_endpoint_request( + _request = build_cdn_get_endpoint_request( cdn_id=cdn_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -79898,9 +83609,9 @@ async def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_endpoints( @@ -79911,6 +83622,7 @@ async def update_endpoints( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a CDN Endpoint. To update the TTL, certificate ID, or the FQDN of the custom subdomain for @@ -79946,6 +83658,9 @@ async def update_endpoints( # response body for status code(s): 200 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -79957,9 +83672,6 @@ async def update_endpoints( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -79983,11 +83695,12 @@ async def update_endpoints( async def update_endpoints( self, cdn_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a CDN Endpoint. To update the TTL, certificate ID, or the FQDN of the custom subdomain for @@ -79997,7 +83710,7 @@ async def update_endpoints( :param cdn_id: A unique identifier for a CDN endpoint. Required. :type cdn_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -80011,6 +83724,9 @@ async def update_endpoints( # response body for status code(s): 200 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -80022,9 +83738,6 @@ async def update_endpoints( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -80046,8 +83759,9 @@ async def update_endpoints( @distributed_trace_async async def update_endpoints( - self, cdn_id: str, body: Union[JSON, IO], **kwargs: Any + self, cdn_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a CDN Endpoint. To update the TTL, certificate ID, or the FQDN of the custom subdomain for @@ -80056,11 +83770,8 @@ async def update_endpoints( :param cdn_id: A unique identifier for a CDN endpoint. Required. :type cdn_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -80068,9 +83779,24 @@ async def update_endpoints( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS + certificate used for SSL when a custom subdomain is provided. + "custom_domain": "str", # Optional. The fully qualified domain name (FQDN) + of the custom subdomain used with the CDN endpoint. + "ttl": 3600 # Optional. Default value is 3600. The amount of time the + content is cached by the CDN's edge servers in seconds. TTL must be one of 60, + 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded. Known + values are: 60, 600, 3600, 86400, and 604800. + } + # response body for status code(s): 200 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -80082,9 +83808,6 @@ async def update_endpoints( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -80103,10 +83826,14 @@ async def update_endpoints( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -80115,20 +83842,20 @@ async def update_endpoints( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_cdn_update_endpoints_request( + _request = build_cdn_update_endpoints_request( cdn_id=cdn_id, content_type=content_type, json=_json, @@ -80136,18 +83863,21 @@ async def update_endpoints( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -80184,12 +83914,13 @@ async def update_endpoints( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_endpoint(self, cdn_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a CDN Endpoint. To delete a specific CDN endpoint, send a DELETE request to @@ -80219,10 +83950,14 @@ async def delete_endpoint(self, cdn_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -80231,25 +83966,28 @@ async def delete_endpoint(self, cdn_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_cdn_delete_endpoint_request( + _request = build_cdn_delete_endpoint_request( cdn_id=cdn_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -80282,9 +84020,9 @@ async def delete_endpoint(self, cdn_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def purge_cache( @@ -80295,12 +84033,13 @@ async def purge_cache( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Purge the Cache for an Existing CDN Endpoint. To purge cached content from a CDN endpoint, send a DELETE request to ``/v2/cdn/endpoints/$ENDPOINT_ID/cache``. The body of the request should include a ``files`` attribute containing a list of cached file paths to be purged. A - path may be for a single file or may contain a wildcard (\ ``*``\ ) to recursively + path may be for a single file or may contain a wildcard (\\ ``*``\\ ) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. @@ -80344,17 +84083,18 @@ async def purge_cache( async def purge_cache( self, cdn_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Purge the Cache for an Existing CDN Endpoint. To purge cached content from a CDN endpoint, send a DELETE request to ``/v2/cdn/endpoints/$ENDPOINT_ID/cache``. The body of the request should include a ``files`` attribute containing a list of cached file paths to be purged. A - path may be for a single file or may contain a wildcard (\ ``*``\ ) to recursively + path may be for a single file or may contain a wildcard (\\ ``*``\\ ) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. @@ -80362,7 +84102,7 @@ async def purge_cache( :param cdn_id: A unique identifier for a CDN endpoint. Required. :type cdn_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -80388,25 +84128,23 @@ async def purge_cache( @distributed_trace_async async def purge_cache( - self, cdn_id: str, body: Union[JSON, IO], **kwargs: Any + self, cdn_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Purge the Cache for an Existing CDN Endpoint. To purge cached content from a CDN endpoint, send a DELETE request to ``/v2/cdn/endpoints/$ENDPOINT_ID/cache``. The body of the request should include a ``files`` attribute containing a list of cached file paths to be purged. A - path may be for a single file or may contain a wildcard (\ ``*``\ ) to recursively + path may be for a single file or may contain a wildcard (\\ ``*``\\ ) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. :param cdn_id: A unique identifier for a CDN endpoint. Required. :type cdn_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -80414,6 +84152,14 @@ async def purge_cache( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "files": [ + "str" # An array of strings containing the path to the content to be + purged from the CDN cache. Required. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -80426,10 +84172,14 @@ async def purge_cache( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -80438,20 +84188,20 @@ async def purge_cache( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_cdn_purge_cache_request( + _request = build_cdn_purge_cache_request( cdn_id=cdn_id, content_type=content_type, json=_json, @@ -80459,18 +84209,21 @@ async def purge_cache( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -80503,9 +84256,9 @@ async def purge_cache( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class CertificatesOperations: @@ -80531,6 +84284,7 @@ def __init__(self, *args, **kwargs) -> None: async def list( self, *, per_page: int = 20, page: int = 1, name: str = "", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Certificates. To list all of the certificates available on your account, send a GET request to @@ -80551,6 +84305,9 @@ async def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "certificates": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -80581,16 +84338,17 @@ async def list( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -80599,27 +84357,30 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_certificates_list_request( + _request = build_certificates_list_request( per_page=per_page, page=page, name=name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -80639,21 +84400,22 @@ async def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Certificate. To upload new SSL certificate which you have previously generated, send a POST request to ``/v2/certificates``. - When uploading a user-generated certificate, the ``private_key``\ , - ``leaf_certificate``\ , and optionally the ``certificate_chain`` attributes should + When uploading a user-generated certificate, the ``private_key``\\ , + ``leaf_certificate``\\ , and optionally the ``certificate_chain`` attributes should be provided. The type must be set to ``custom``. When using Let's Encrypt to create a certificate, the ``dns_names`` attribute @@ -80706,22 +84468,23 @@ async def create( @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Certificate. To upload new SSL certificate which you have previously generated, send a POST request to ``/v2/certificates``. - When uploading a user-generated certificate, the ``private_key``\ , - ``leaf_certificate``\ , and optionally the ``certificate_chain`` attributes should + When uploading a user-generated certificate, the ``private_key``\\ , + ``leaf_certificate``\\ , and optionally the ``certificate_chain`` attributes should be provided. The type must be set to ``custom``. When using Let's Encrypt to create a certificate, the ``dns_names`` attribute must be provided, and the type must be set to ``lets_encrypt``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -80763,24 +84526,22 @@ async def create( """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Certificate. To upload new SSL certificate which you have previously generated, send a POST request to ``/v2/certificates``. - When uploading a user-generated certificate, the ``private_key``\ , - ``leaf_certificate``\ , and optionally the ``certificate_chain`` attributes should + When uploading a user-generated certificate, the ``private_key``\\ , + ``leaf_certificate``\\ , and optionally the ``certificate_chain`` attributes should be provided. The type must be set to ``custom``. When using Let's Encrypt to create a certificate, the ``dns_names`` attribute must be provided, and the type must be set to ``lets_encrypt``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -80788,6 +84549,9 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "certificate": { @@ -80817,10 +84581,14 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -80829,38 +84597,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_certificates_create_request( + _request = build_certificates_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -80880,12 +84651,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, certificate_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Certificate. To show information about an existing certificate, send a GET request to @@ -80940,10 +84712,14 @@ async def get(self, certificate_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -80952,25 +84728,28 @@ async def get(self, certificate_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_certificates_get_request( + _request = build_certificates_get_request( certificate_id=certificate_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -81007,12 +84786,13 @@ async def get(self, certificate_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, certificate_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Certificate. To delete a specific certificate, send a DELETE request to @@ -81039,10 +84819,14 @@ async def delete(self, certificate_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -81051,25 +84835,28 @@ async def delete(self, certificate_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_certificates_delete_request( + _request = build_certificates_delete_request( certificate_id=certificate_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -81102,9 +84889,9 @@ async def delete(self, certificate_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class BalanceOperations: @@ -81128,6 +84915,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Customer Balance. To retrieve the balances on a customer's account, send a GET request to @@ -81164,10 +84952,14 @@ async def get(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -81176,24 +84968,27 @@ async def get(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_balance_get_request( + _request = build_balance_get_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -81230,9 +85025,9 @@ async def get(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class BillingHistoryOperations: @@ -81256,6 +85051,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Billing History. To retrieve a list of all billing history entries, send a GET request to @@ -81270,6 +85066,9 @@ async def list(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "billing_history": [ { "amount": "str", # Optional. Amount of the billing history @@ -81290,9 +85089,6 @@ async def list(self, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -81307,10 +85103,14 @@ async def list(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -81319,24 +85119,27 @@ async def list(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_billing_history_list_request( + _request = build_billing_history_list_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -81373,9 +85176,9 @@ async def list(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class InvoicesOperations: @@ -81399,6 +85202,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Invoices. To retrieve a list of all invoices, send a GET request to ``/v2/customers/my/invoices``. @@ -81416,6 +85220,9 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "invoice_preview": { "amount": "str", # Optional. Total amount of the invoice, in USD. This will reflect month-to-date usage in the invoice preview. @@ -81444,16 +85251,17 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -81462,26 +85270,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_invoices_list_request( + _request = build_invoices_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -81501,12 +85312,13 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Invoice by UUID. To retrieve the invoice items for an invoice, send a GET request to @@ -81523,6 +85335,9 @@ async def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "invoice_items": [ { "amount": "str", # Optional. Billed amount of this invoice @@ -81552,9 +85367,6 @@ async def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -81569,10 +85381,14 @@ async def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -81581,25 +85397,28 @@ async def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_invoices_get_by_uuid_request( + _request = build_invoices_get_by_uuid_request( invoice_uuid=invoice_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -81636,14 +85455,15 @@ async def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_csv_by_uuid( self, invoice_uuid: str, **kwargs: Any ) -> Union[str, JSON]: + # pylint: disable=line-too-long """Retrieve an Invoice CSV by UUID. To retrieve a CSV for an invoice, send a GET request to @@ -81670,10 +85490,14 @@ async def get_csv_by_uuid( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -81682,25 +85506,28 @@ async def get_csv_by_uuid( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Union[str, JSON]] + cls: ClsType[Union[str, JSON]] = kwargs.pop("cls", None) - request = build_invoices_get_csv_by_uuid_request( + _request = build_invoices_get_csv_by_uuid_request( invoice_uuid=invoice_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -81740,18 +85567,15 @@ async def get_csv_by_uuid( deserialized = None if cls: - return cls( - pipeline_response, - cast(Union[str, JSON], deserialized), - response_headers, - ) + return cls(pipeline_response, cast(Union[str, JSON], deserialized), response_headers) # type: ignore - return cast(Union[str, JSON], deserialized) + return cast(Union[str, JSON], deserialized) # type: ignore @distributed_trace_async async def get_pdf_by_uuid( self, invoice_uuid: str, **kwargs: Any ) -> Union[AsyncIterator[bytes], JSON]: + # pylint: disable=line-too-long """Retrieve an Invoice PDF by UUID. To retrieve a PDF for an invoice, send a GET request to @@ -81759,7 +85583,7 @@ async def get_pdf_by_uuid( :param invoice_uuid: UUID of the invoice. Required. :type invoice_uuid: str - :return: Async iterator of the response bytes or JSON object + :return: AsyncIterator[bytes] or JSON object :rtype: AsyncIterator[bytes] or JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -81778,10 +85602,14 @@ async def get_pdf_by_uuid( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -81790,27 +85618,28 @@ async def get_pdf_by_uuid( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop( - "cls", None - ) # type: ClsType[Union[AsyncIterator[bytes], JSON]] + cls: ClsType[Union[AsyncIterator[bytes], JSON]] = kwargs.pop("cls", None) - request = build_invoices_get_pdf_by_uuid_request( + _request = build_invoices_get_pdf_by_uuid_request( invoice_uuid=invoice_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=True, **kwargs + _stream = True + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -81841,22 +85670,16 @@ async def get_pdf_by_uuid( "int", response.headers.get("ratelimit-reset") ) - if response.content: - deserialized = response.json() - else: - deserialized = None + deserialized = response.iter_bytes() if cls: - return cls( - pipeline_response, - cast(Union[AsyncIterator[bytes], JSON], deserialized), - response_headers, - ) + return cls(pipeline_response, cast(Union[AsyncIterator[bytes], JSON], deserialized), response_headers) # type: ignore - return cast(Union[AsyncIterator[bytes], JSON], deserialized) + return cast(Union[AsyncIterator[bytes], JSON], deserialized) # type: ignore @distributed_trace_async async def get_summary_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Invoice Summary by UUID. To retrieve a summary for an invoice, send a GET request to @@ -81934,10 +85757,14 @@ async def get_summary_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -81946,25 +85773,28 @@ async def get_summary_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_invoices_get_summary_by_uuid_request( + _request = build_invoices_get_summary_by_uuid_request( invoice_uuid=invoice_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -82001,9 +85831,9 @@ async def get_summary_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class DatabasesOperations: # pylint: disable=too-many-public-methods @@ -82027,6 +85857,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list_options(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Database Options. To list all of the options available for the offered database engines, send a GET request to @@ -82281,10 +86112,14 @@ async def list_options(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -82293,24 +86128,27 @@ async def list_options(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_options_request( + _request = build_databases_list_options_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -82347,14 +86185,15 @@ async def list_options(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_clusters( self, *, tag_name: Optional[str] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Database Clusters. To list all of the database clusters available on your account, send a GET request to @@ -82387,6 +86226,19 @@ async def list_clusters( response == { "databases": [ { + "engine": "str", # A slug representing the database engine + used for the cluster. The possible values are: "pg" for PostgreSQL, + "mysql" for MySQL, "redis" for Redis, "mongodb" for MongoDB, "kafka" for + Kafka and "opensearch" for Opensearch. Required. Known values are: "pg", + "mysql", "redis", "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to + a database cluster. Required. + "num_nodes": 0, # The number of nodes in the database + cluster. Required. + "region": "str", # The slug identifier for the region where + the database cluster is located. Required. + "size": "str", # The slug identifier representing the size + of the nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -82412,22 +86264,17 @@ async def list_clusters( "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine - used for the cluster. The possible values are: "pg" for PostgreSQL, - "mysql" for MySQL, "redis" for Redis, "mongodb" for MongoDB, "kafka" for - Kafka and "opensearch" for Opensearch. Required. Known values are: "pg", - "mysql", "redis", "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which + maintenance updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which - maintenance updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. @@ -82440,10 +86287,6 @@ async def list_clusters( service is listening. } ], - "name": "str", # A unique, human-readable name referring to - a database cluster. Required. - "num_nodes": 0, # The number of nodes in the database - cluster. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -82469,31 +86312,27 @@ async def list_clusters( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where - the database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique - ID for the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # - Optional. A time value given in ISO8601 combined date and time - format that represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for - the firewall rule itself. - "value": "str" # The ID of the specific + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique + ID for the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # + Optional. A time value given in ISO8601 combined date and time + format that represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for + the firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size - of the nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -82558,6 +86397,8 @@ async def list_clusters( }, "users": [ { + "name": "str", # The name of a database + user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key @@ -82565,28 +86406,21 @@ async def list_clusters( "mysql_settings": { "auth_plugin": "str" # A string specifying the authentication method to be used for - connections"nto the MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the - version of MySQL in use will be used. As of MySQL 8.0, - the"ndefault is ``caching_sha2_password``. Required. Known - values are: "mysql_native_password" and - "caching_sha2_password". + connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If + excluded when creating a new user, the default for the + version of MySQL in use will be used. As of MySQL 8.0, the + default is ``caching_sha2_password``. Required. Known values + are: "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database - user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string - representing the database user's role. The value will be - either"n"primary" or "normal". Known values are: "primary" and - "normal". + representing the database user's role. The value will be either + "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # - Optional. An identifier for the ACL. Will be computed - after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' @@ -82597,14 +86431,17 @@ async def list_clusters( administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # + Optional. An identifier for the ACL. Will be computed + after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user - with replication rights."nThis option is not currently + with replication rights. This option is not currently supported for other database engines. } } @@ -82633,10 +86470,14 @@ async def list_clusters( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -82645,25 +86486,28 @@ async def list_clusters( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_clusters_request( + _request = build_databases_list_clusters_request( tag_name=tag_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -82700,14 +86544,15 @@ async def list_clusters( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_cluster( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Database Cluster. To create a database cluster, send a POST request to ``/v2/databases``. @@ -82743,12 +86588,24 @@ async def create_cluster( # JSON input template you can fill out and use as your body input. body = { + "engine": "str", # A slug representing the database engine used for the + cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, "redis" + for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" for + Opensearch. Required. Known values are: "pg", "mysql", "redis", "mongodb", + "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a database + cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. Required. + "region": "str", # The slug identifier for the region where the database + cluster is located. Required. + "size": "str", # The slug identifier representing the size of the nodes in + the database cluster. Required. "backup_restore": { - "backup_created_at": "2020-02-20 00:00:00", # Optional. The - timestamp of an existing database cluster backup in ISO8601 combined date and - time format. The most recent backup will be used if excluded. - "database_name": "str" # The name of an existing database cluster + "database_name": "str", # The name of an existing database cluster from which the backup will be restored. Required. + "backup_created_at": "2020-02-20 00:00:00" # Optional. The timestamp + of an existing database cluster backup in ISO8601 combined date and time + format. The most recent backup will be used if excluded. }, "connection": { "database": "str", # Optional. The name of the default database. @@ -82772,22 +86629,17 @@ async def create_cluster( "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for the - cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, "redis" - for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" for - Opensearch. Required. Known values are: "pg", "mysql", "redis", "mongodb", - "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance updates will + be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance updates will - be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -82799,9 +86651,6 @@ async def create_cluster( listening. } ], - "name": "str", # A unique, human-readable name referring to a database - cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. Required. "private_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -82824,29 +86673,25 @@ async def create_cluster( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the database - cluster is located. Required. "rules": [ { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. "cluster_uuid": "str", # Optional. A unique ID for the database cluster to which the rule is applied. "created_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the firewall rule was created. - "type": "str", # The type of resource that the firewall rule - allows to access the database cluster. Required. Known values are: - "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the firewall rule + "uuid": "str" # Optional. A unique ID for the firewall rule itself. - "value": "str" # The ID of the specific resource, the name - of a tag applied to a group of resources, or the IP address that the - firewall rule allows to access the database cluster. Required. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the nodes in - the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -82904,31 +86749,28 @@ async def create_cluster( }, "users": [ { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of - MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. Known - values are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL + 8.0, the default is ``caching_sha2_password``. Required. Known values + are: "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or "normal". + database user's role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be @@ -82937,14 +86779,17 @@ async def create_cluster( 'produceconsume' as well as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other database + rights. This option is not currently supported for other database engines. } } @@ -82962,6 +86807,19 @@ async def create_cluster( # response body for status code(s): 201 response == { "database": { + "engine": "str", # A slug representing the database engine used for + the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, + "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" + for Opensearch. Required. Known values are: "pg", "mysql", "redis", + "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a + database cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. + Required. + "region": "str", # The slug identifier for the region where the + database cluster is located. Required. + "size": "str", # The slug identifier representing the size of the + nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -82985,22 +86843,17 @@ async def create_cluster( "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for - the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, - "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" - for Opensearch. Required. Known values are: "pg", "mysql", "redis", - "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance + updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance - updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -83012,10 +86865,6 @@ async def create_cluster( listening. } ], - "name": "str", # A unique, human-readable name referring to a - database cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -83039,30 +86888,26 @@ async def create_cluster( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the - database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique ID for - the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # Optional. A - time value given in ISO8601 combined date and time format that - represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the - firewall rule itself. - "value": "str" # The ID of the specific resource, + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for + the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A + time value given in ISO8601 combined date and time format that + represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the + firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the - nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -83122,33 +86967,30 @@ async def create_cluster( }, "users": [ { + "name": "str", # The name of a database user. + Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying - the authentication method to be used for connections"nto the - MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the version - of MySQL in use will be used. As of MySQL 8.0, the"ndefault is - ``caching_sha2_password``. Required. Known values are: - "mysql_native_password" and "caching_sha2_password". + the authentication method to be used for connections to the MySQL + user account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, + the default for the version of MySQL in use will be used. As of + MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and + "caching_sha2_password". }, - "name": "str", # The name of a database user. - Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or - "normal". Known values are: "primary" and "normal". + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows @@ -83158,15 +87000,18 @@ async def create_cluster( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for - matching the topic(s) that this ACL should apply to. + "topic": "str", # A regex + for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other - database engines. + rights. This option is not currently supported for other database + engines. } } ], @@ -83196,8 +87041,9 @@ async def create_cluster( @overload async def create_cluster( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Database Cluster. To create a database cluster, send a POST request to ``/v2/databases``. @@ -83220,7 +87066,7 @@ async def create_cluster( Note: Backups are not supported for Redis clusters. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -83234,6 +87080,19 @@ async def create_cluster( # response body for status code(s): 201 response == { "database": { + "engine": "str", # A slug representing the database engine used for + the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, + "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" + for Opensearch. Required. Known values are: "pg", "mysql", "redis", + "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a + database cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. + Required. + "region": "str", # The slug identifier for the region where the + database cluster is located. Required. + "size": "str", # The slug identifier representing the size of the + nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -83257,22 +87116,17 @@ async def create_cluster( "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for - the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, - "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" - for Opensearch. Required. Known values are: "pg", "mysql", "redis", - "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance + updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance - updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -83284,10 +87138,6 @@ async def create_cluster( listening. } ], - "name": "str", # A unique, human-readable name referring to a - database cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -83311,30 +87161,26 @@ async def create_cluster( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the - database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique ID for - the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # Optional. A - time value given in ISO8601 combined date and time format that - represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the - firewall rule itself. - "value": "str" # The ID of the specific resource, + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for + the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A + time value given in ISO8601 combined date and time format that + represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the + firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the - nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -83394,33 +87240,30 @@ async def create_cluster( }, "users": [ { + "name": "str", # The name of a database user. + Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying - the authentication method to be used for connections"nto the - MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the version - of MySQL in use will be used. As of MySQL 8.0, the"ndefault is - ``caching_sha2_password``. Required. Known values are: - "mysql_native_password" and "caching_sha2_password". + the authentication method to be used for connections to the MySQL + user account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, + the default for the version of MySQL in use will be used. As of + MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and + "caching_sha2_password". }, - "name": "str", # The name of a database user. - Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or - "normal". Known values are: "primary" and "normal". + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows @@ -83430,15 +87273,18 @@ async def create_cluster( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for - matching the topic(s) that this ACL should apply to. + "topic": "str", # A regex + for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other - database engines. + rights. This option is not currently supported for other database + engines. } } ], @@ -83467,7 +87313,8 @@ async def create_cluster( """ @distributed_trace_async - async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Database Cluster. To create a database cluster, send a POST request to ``/v2/databases``. @@ -83489,11 +87336,8 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: forking a database in the control panel. Note: Backups are not supported for Redis clusters. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -83501,9 +87345,240 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "engine": "str", # A slug representing the database engine used for the + cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, "redis" + for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" for + Opensearch. Required. Known values are: "pg", "mysql", "redis", "mongodb", + "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a database + cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. Required. + "region": "str", # The slug identifier for the region where the database + cluster is located. Required. + "size": "str", # The slug identifier representing the size of the nodes in + the database cluster. Required. + "backup_restore": { + "database_name": "str", # The name of an existing database cluster + from which the backup will be restored. Required. + "backup_created_at": "2020-02-20 00:00:00" # Optional. The timestamp + of an existing database cluster backup in ISO8601 combined date and time + format. The most recent backup will be used if excluded. + }, + "connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the database cluster + was created. + "db_names": [ + "str" # Optional. An array of strings containing the names of + databases created in the database cluster. + ], + "id": "str", # Optional. A unique ID that can be used to identify and + reference a database cluster. + "maintenance_window": { + "day": "str", # The day of the week on which to apply maintenance + updates. Required. + "hour": "str", # The hour in UTC at which maintenance updates will + be applied in 24 hour format. Required. + "description": [ + "str" # Optional. A list of strings, each containing + information about a pending maintenance update. + ], + "pending": bool # Optional. A boolean value indicating whether any + maintenance is scheduled to be performed in the next window. + }, + "metrics_endpoints": [ + { + "host": "str", # Optional. A FQDN pointing to the database + cluster's node(s). + "port": 0 # Optional. The port on which a service is + listening. + } + ], + "private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "private_network_uuid": "str", # Optional. A string specifying the UUID of + the VPC to which the database cluster will be assigned. If excluded, the cluster + when creating a new database cluster, it will be assigned to your account's + default VPC for the region. + "project_id": "str", # Optional. The ID of the project that the database + cluster is assigned to. If excluded when creating a new database cluster, it will + be assigned to your default project. + "rules": [ + { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for the + database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the firewall rule + itself. + } + ], + "semantic_version": "str", # Optional. A string representing the semantic + version of the database engine in use for the cluster. + "standby_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "standby_private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "status": "str", # Optional. A string representing the current status of the + database cluster. Known values are: "creating", "online", "resizing", + "migrating", and "forking". + "storage_size_mib": 0, # Optional. Additional storage added to the cluster, + in MiB. If null, no additional storage is added to the cluster, beyond what is + provided as a base amount from the 'size' and any previously added additional + storage. + "tags": [ + "str" # Optional. An array of tags that have been applied to the + database cluster. + ], + "ui_connection": { + "host": "str", # Optional. The FQDN pointing to the opensearch + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the opensearch dashboard is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. This is provided as a convenience and + should be able to be constructed by the other attributes. + "user": "str" # Optional. The default user for the opensearch + dashboard. + }, + "users": [ + { + "name": "str", # The name of a database user. Required. + "access_cert": "str", # Optional. Access certificate for TLS + client authentication. (Kafka only). + "access_key": "str", # Optional. Access key for TLS client + authentication. (Kafka only). + "mysql_settings": { + "auth_plugin": "str" # A string specifying the + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL + 8.0, the default is ``caching_sha2_password``. Required. Known values + are: "mysql_native_password" and "caching_sha2_password". + }, + "password": "str", # Optional. A randomly generated password + for the database user. + "role": "str", # Optional. A string representing the + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". + "settings": { + "acl": [ + { + "permission": "str", # Permission + set applied to the ACL. 'consume' allows for messages to be + consumed from the topic. 'produce' allows for messages to be + published to the topic. 'produceconsume' allows for both + 'consume' and 'produce' permission. 'admin' allows for + 'produceconsume' as well as any operations to administer the + topic (delete, update). Required. Known values are: "admin", + "consume", "produce", and "produceconsume". + "topic": "str", # A regex for + matching the topic(s) that this ACL should apply to. + Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. + } + ], + "pg_allow_replication": bool # Optional. For + Postgres clusters, set to ``true`` for a user with replication + rights. This option is not currently supported for other database + engines. + } + } + ], + "version": "str", # Optional. A string representing the version of the + database engine in use for the cluster. + "version_end_of_availability": "str", # Optional. A timestamp referring to + the date when the particular version will no longer be available for creating new + clusters. If null, the version does not have an end of availability timeline. + "version_end_of_life": "str" # Optional. A timestamp referring to the date + when the particular version will no longer be supported. If null, the version + does not have an end of life timeline. + } + # response body for status code(s): 201 response == { "database": { + "engine": "str", # A slug representing the database engine used for + the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, + "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" + for Opensearch. Required. Known values are: "pg", "mysql", "redis", + "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a + database cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. + Required. + "region": "str", # The slug identifier for the region where the + database cluster is located. Required. + "size": "str", # The slug identifier representing the size of the + nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -83527,22 +87602,17 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for - the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, - "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" - for Opensearch. Required. Known values are: "pg", "mysql", "redis", - "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance + updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance - updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -83554,10 +87624,6 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: listening. } ], - "name": "str", # A unique, human-readable name referring to a - database cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -83581,30 +87647,26 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the - database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique ID for - the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # Optional. A - time value given in ISO8601 combined date and time format that - represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the - firewall rule itself. - "value": "str" # The ID of the specific resource, + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for + the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A + time value given in ISO8601 combined date and time format that + represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the + firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the - nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -83664,33 +87726,30 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "users": [ { + "name": "str", # The name of a database user. + Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying - the authentication method to be used for connections"nto the - MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the version - of MySQL in use will be used. As of MySQL 8.0, the"ndefault is - ``caching_sha2_password``. Required. Known values are: - "mysql_native_password" and "caching_sha2_password". + the authentication method to be used for connections to the MySQL + user account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, + the default for the version of MySQL in use will be used. As of + MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and + "caching_sha2_password". }, - "name": "str", # The name of a database user. - Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or - "normal". Known values are: "primary" and "normal". + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows @@ -83700,15 +87759,18 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for - matching the topic(s) that this ACL should apply to. + "topic": "str", # A regex + for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other - database engines. + rights. This option is not currently supported for other database + engines. } } ], @@ -83735,10 +87797,14 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -83747,38 +87813,41 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_create_cluster_request( + _request = build_databases_create_cluster_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -83815,12 +87884,13 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Database Cluster. To show information about an existing database cluster, send a GET request to @@ -83849,6 +87919,19 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "database": { + "engine": "str", # A slug representing the database engine used for + the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, + "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" + for Opensearch. Required. Known values are: "pg", "mysql", "redis", + "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a + database cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. + Required. + "region": "str", # The slug identifier for the region where the + database cluster is located. Required. + "size": "str", # The slug identifier representing the size of the + nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -83872,22 +87955,17 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for - the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, - "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" - for Opensearch. Required. Known values are: "pg", "mysql", "redis", - "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance + updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance - updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -83899,10 +87977,6 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: listening. } ], - "name": "str", # A unique, human-readable name referring to a - database cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -83926,30 +88000,26 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the - database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique ID for - the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # Optional. A - time value given in ISO8601 combined date and time format that - represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the - firewall rule itself. - "value": "str" # The ID of the specific resource, + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for + the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A + time value given in ISO8601 combined date and time format that + represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the + firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the - nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -84009,33 +88079,30 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: }, "users": [ { + "name": "str", # The name of a database user. + Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying - the authentication method to be used for connections"nto the - MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the version - of MySQL in use will be used. As of MySQL 8.0, the"ndefault is - ``caching_sha2_password``. Required. Known values are: - "mysql_native_password" and "caching_sha2_password". + the authentication method to be used for connections to the MySQL + user account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, + the default for the version of MySQL in use will be used. As of + MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and + "caching_sha2_password". }, - "name": "str", # The name of a database user. - Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or - "normal". Known values are: "primary" and "normal". + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows @@ -84045,15 +88112,18 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for - matching the topic(s) that this ACL should apply to. + "topic": "str", # A regex + for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other - database engines. + rights. This option is not currently supported for other database + engines. } } ], @@ -84080,10 +88150,14 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84092,25 +88166,28 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_cluster_request( + _request = build_databases_get_cluster_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -84147,14 +88224,15 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def destroy_cluster( self, database_cluster_uuid: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Destroy a Database Cluster. To destroy a specific database, send a DELETE request to ``/v2/databases/$DATABASE_ID``. @@ -84182,10 +88260,14 @@ async def destroy_cluster( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84194,25 +88276,28 @@ async def destroy_cluster( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_destroy_cluster_request( + _request = build_databases_destroy_cluster_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -84245,12 +88330,13 @@ async def destroy_cluster( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_config(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Database Cluster Configuration. Shows configuration parameters for an existing database cluster by sending a GET request to @@ -84283,10 +88369,14 @@ async def get_config(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84295,25 +88385,28 @@ async def get_config(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_config_request( + _request = build_databases_get_config_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -84350,9 +88443,9 @@ async def get_config(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def patch_config( @@ -84363,6 +88456,7 @@ async def patch_config( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update the Database Configuration for an Existing Database. To update the configuration for an existing database cluster, send a PATCH request to @@ -84404,11 +88498,12 @@ async def patch_config( async def patch_config( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update the Database Configuration for an Existing Database. To update the configuration for an existing database cluster, send a PATCH request to @@ -84417,7 +88512,7 @@ async def patch_config( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -84443,8 +88538,9 @@ async def patch_config( @distributed_trace_async async def patch_config( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update the Database Configuration for an Existing Database. To update the configuration for an existing database cluster, send a PATCH request to @@ -84452,11 +88548,8 @@ async def patch_config( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -84464,6 +88557,11 @@ async def patch_config( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "config": {} + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -84476,10 +88574,14 @@ async def patch_config( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84488,20 +88590,20 @@ async def patch_config( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_patch_config_request( + _request = build_databases_patch_config_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -84509,18 +88611,21 @@ async def patch_config( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -84553,12 +88658,13 @@ async def patch_config( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_ca(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve the Public Certificate. To retrieve the public certificate used to secure the connection to the database cluster send a @@ -84596,10 +88702,14 @@ async def get_ca(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84608,25 +88718,28 @@ async def get_ca(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_ca_request( + _request = build_databases_get_ca_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -84663,14 +88776,15 @@ async def get_ca(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_migration_status( self, database_cluster_uuid: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve the Status of an Online Migration. To retrieve the status of the most recent online migration, send a GET request to @@ -84705,10 +88819,14 @@ async def get_migration_status( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84717,25 +88835,28 @@ async def get_migration_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_migration_status_request( + _request = build_databases_get_migration_status_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -84772,9 +88893,9 @@ async def get_migration_status( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_online_migration( @@ -84785,6 +88906,7 @@ async def update_online_migration( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Start an Online Migration. To start an online migration, send a PUT request to @@ -84851,11 +88973,12 @@ async def update_online_migration( async def update_online_migration( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Start an Online Migration. To start an online migration, send a PUT request to @@ -84866,7 +88989,7 @@ async def update_online_migration( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -84900,8 +89023,9 @@ async def update_online_migration( @distributed_trace_async async def update_online_migration( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Start an Online Migration. To start an online migration, send a PUT request to @@ -84911,11 +89035,8 @@ async def update_online_migration( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -84923,6 +89044,26 @@ async def update_online_migration( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "disable_ssl": bool, # Optional. Enables SSL encryption when connecting to + the source database. + "ignore_dbs": [ + "str" # Optional. List of databases that should be ignored during + migration. + ], + "source": { + "dbname": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "username": "str" # Optional. The default user for the database. + } + } + # response body for status code(s): 200 response == { "created_at": "str", # Optional. The time the migration was initiated, in @@ -84943,10 +89084,14 @@ async def update_online_migration( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84955,20 +89100,20 @@ async def update_online_migration( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_online_migration_request( + _request = build_databases_update_online_migration_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -84976,18 +89121,21 @@ async def update_online_migration( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -85024,14 +89172,15 @@ async def update_online_migration( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_online_migration( self, database_cluster_uuid: str, migration_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Stop an Online Migration. To stop an online migration, send a DELETE request to @@ -85063,10 +89212,14 @@ async def delete_online_migration( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -85075,26 +89228,29 @@ async def delete_online_migration( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_online_migration_request( + _request = build_databases_delete_online_migration_request( database_cluster_uuid=database_cluster_uuid, migration_id=migration_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -85127,9 +89283,9 @@ async def delete_online_migration( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def update_region( @@ -85140,6 +89296,7 @@ async def update_region( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Migrate a Database Cluster to a New Region. To migrate a database cluster to a new region, send a ``PUT`` request to @@ -85188,11 +89345,55 @@ async def update_region( async def update_region( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Migrate a Database Cluster to a New Region. + + To migrate a database cluster to a new region, send a ``PUT`` request to + ``/v2/databases/$DATABASE_ID/migrate``. The body of the request must specify a + ``region`` attribute. + + A successful request will receive a 202 Accepted status code with no body in + response. Querying the database cluster will show that its ``status`` attribute + will now be set to ``migrating``. This will transition back to ``online`` when the + migration has completed. + + :param database_cluster_uuid: A unique identifier for a database cluster. Required. + :type database_cluster_uuid: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update_region( + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> Optional[JSON]: + # pylint: disable=line-too-long """Migrate a Database Cluster to a New Region. To migrate a database cluster to a new region, send a ``PUT`` request to @@ -85204,10 +89405,203 @@ async def update_region( will now be set to ``migrating``. This will transition back to ``online`` when the migration has completed. + :param database_cluster_uuid: A unique identifier for a database cluster. Required. + :type database_cluster_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "region": "str" # A slug identifier for the region to which the database + cluster will be migrated. Required. + } + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_databases_update_region_request( + database_cluster_uuid=database_cluster_uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + deserialized = None + response_headers = {} + if response.status_code == 202: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_cluster_size( + self, + database_cluster_uuid: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Resize a Database Cluster. + + To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The + body of the request must specify both the size and num_nodes attributes. + A successful request will receive a 202 Accepted status code with no body in response. Querying + the database cluster will show that its status attribute will now be set to resizing. This will + transition back to online when the resize operation has completed. + + :param database_cluster_uuid: A unique identifier for a database cluster. Required. + :type database_cluster_uuid: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "num_nodes": 0, # The number of nodes in the database cluster. Valid values + are are 1-3. In addition to the primary node, up to two standby nodes may be + added for highly available configurations. Required. + "size": "str", # A slug identifier representing desired the size of the + nodes in the database cluster. Required. + "storage_size_mib": 0 # Optional. Additional storage added to the cluster, + in MiB. If null, no additional storage is added to the cluster, beyond what is + provided as a base amount from the 'size' and any previously added additional + storage. + } + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def update_cluster_size( + self, + database_cluster_uuid: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Resize a Database Cluster. + + To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The + body of the request must specify both the size and num_nodes attributes. + A successful request will receive a 202 Accepted status code with no body in response. Querying + the database cluster will show that its status attribute will now be set to resizing. This will + transition back to online when the resize operation has completed. + :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -85232,136 +89626,10 @@ async def update_region( """ @distributed_trace_async - async def update_region( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any - ) -> Optional[JSON]: - """Migrate a Database Cluster to a New Region. - - To migrate a database cluster to a new region, send a ``PUT`` request to - ``/v2/databases/$DATABASE_ID/migrate``. The body of the request must specify a - ``region`` attribute. - - A successful request will receive a 202 Accepted status code with no body in - response. Querying the database cluster will show that its ``status`` attribute - will now be set to ``migrating``. This will transition back to ``online`` when the - migration has completed. - - :param database_cluster_uuid: A unique identifier for a database cluster. Required. - :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_databases_update_region_request( - database_cluster_uuid=database_cluster_uuid, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - deserialized = None - response_headers = {} - if response.status_code == 202: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - @overload async def update_cluster_size( - self, - database_cluster_uuid: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Resize a Database Cluster. To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The @@ -85372,11 +89640,8 @@ async def update_cluster_size( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -85409,93 +89674,14 @@ async def update_cluster_size( tickets to help identify the issue. } """ - - @overload - async def update_cluster_size( - self, - database_cluster_uuid: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[JSON]: - """Resize a Database Cluster. - - To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The - body of the request must specify both the size and num_nodes attributes. - A successful request will receive a 202 Accepted status code with no body in response. Querying - the database cluster will show that its status attribute will now be set to resizing. This will - transition back to online when the resize operation has completed. - - :param database_cluster_uuid: A unique identifier for a database cluster. Required. - :type database_cluster_uuid: str - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace_async - async def update_cluster_size( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any - ) -> Optional[JSON]: - """Resize a Database Cluster. - - To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The - body of the request must specify both the size and num_nodes attributes. - A successful request will receive a 202 Accepted status code with no body in response. Querying - the database cluster will show that its status attribute will now be set to resizing. This will - transition back to online when the resize operation has completed. - - :param database_cluster_uuid: A unique identifier for a database cluster. Required. - :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -85504,20 +89690,20 @@ async def update_cluster_size( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_cluster_size_request( + _request = build_databases_update_cluster_size_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -85525,18 +89711,21 @@ async def update_cluster_size( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -85569,14 +89758,15 @@ async def update_cluster_size( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_firewall_rules( self, database_cluster_uuid: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Firewall Rules (Trusted Sources) for a Database Cluster. To list all of a database cluster's firewall rules (known as "trusted sources" in the control @@ -85596,19 +89786,19 @@ async def list_firewall_rules( response == { "rules": [ { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. "cluster_uuid": "str", # Optional. A unique ID for the database cluster to which the rule is applied. "created_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the firewall rule was created. - "type": "str", # The type of resource that the firewall rule - allows to access the database cluster. Required. Known values are: - "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the firewall rule + "uuid": "str" # Optional. A unique ID for the firewall rule itself. - "value": "str" # The ID of the specific resource, the name - of a tag applied to a group of resources, or the IP address that the - firewall rule allows to access the database cluster. Required. } ] } @@ -85624,10 +89814,14 @@ async def list_firewall_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -85636,25 +89830,28 @@ async def list_firewall_rules( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_firewall_rules_request( + _request = build_databases_list_firewall_rules_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -85691,9 +89888,9 @@ async def list_firewall_rules( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_firewall_rules( @@ -85704,6 +89901,7 @@ async def update_firewall_rules( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Firewall Rules (Trusted Sources) for a Database. To update a database cluster's firewall rules (known as "trusted sources" in the control @@ -85734,19 +89932,19 @@ async def update_firewall_rules( body = { "rules": [ { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. "cluster_uuid": "str", # Optional. A unique ID for the database cluster to which the rule is applied. "created_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the firewall rule was created. - "type": "str", # The type of resource that the firewall rule - allows to access the database cluster. Required. Known values are: - "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the firewall rule + "uuid": "str" # Optional. A unique ID for the firewall rule itself. - "value": "str" # The ID of the specific resource, the name - of a tag applied to a group of resources, or the IP address that the - firewall rule allows to access the database cluster. Required. } ] } @@ -85768,11 +89966,12 @@ async def update_firewall_rules( async def update_firewall_rules( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Firewall Rules (Trusted Sources) for a Database. To update a database cluster's firewall rules (known as "trusted sources" in the control @@ -85788,7 +89987,7 @@ async def update_firewall_rules( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -85814,8 +90013,9 @@ async def update_firewall_rules( @distributed_trace_async async def update_firewall_rules( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Firewall Rules (Trusted Sources) for a Database. To update a database cluster's firewall rules (known as "trusted sources" in the control @@ -85830,11 +90030,8 @@ async def update_firewall_rules( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -85842,6 +90039,27 @@ async def update_firewall_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "rules": [ + { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for the + database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the firewall rule + itself. + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -85854,10 +90072,14 @@ async def update_firewall_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -85866,20 +90088,20 @@ async def update_firewall_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_firewall_rules_request( + _request = build_databases_update_firewall_rules_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -85887,18 +90109,21 @@ async def update_firewall_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -85931,9 +90156,9 @@ async def update_firewall_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def update_maintenance_window( @@ -85944,6 +90169,7 @@ async def update_maintenance_window( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure a Database Cluster's Maintenance Window. To configure the window when automatic maintenance should be performed for a database cluster, @@ -85968,12 +90194,12 @@ async def update_maintenance_window( body = { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance updates will be + applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance updates will be - applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. } @@ -85995,11 +90221,12 @@ async def update_maintenance_window( async def update_maintenance_window( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure a Database Cluster's Maintenance Window. To configure the window when automatic maintenance should be performed for a database cluster, @@ -86009,7 +90236,7 @@ async def update_maintenance_window( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -86035,8 +90262,9 @@ async def update_maintenance_window( @distributed_trace_async async def update_maintenance_window( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure a Database Cluster's Maintenance Window. To configure the window when automatic maintenance should be performed for a database cluster, @@ -86045,11 +90273,8 @@ async def update_maintenance_window( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -86057,6 +90282,20 @@ async def update_maintenance_window( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "day": "str", # The day of the week on which to apply maintenance updates. + Required. + "hour": "str", # The hour in UTC at which maintenance updates will be + applied in 24 hour format. Required. + "description": [ + "str" # Optional. A list of strings, each containing information + about a pending maintenance update. + ], + "pending": bool # Optional. A boolean value indicating whether any + maintenance is scheduled to be performed in the next window. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -86069,10 +90308,14 @@ async def update_maintenance_window( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86081,20 +90324,20 @@ async def update_maintenance_window( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_maintenance_window_request( + _request = build_databases_update_maintenance_window_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -86102,18 +90345,21 @@ async def update_maintenance_window( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -86146,17 +90392,18 @@ async def update_maintenance_window( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_backups(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Backups for a Database Cluster. To list all of the available backups of a PostgreSQL or MySQL database cluster, send a GET request to ``/v2/databases/$DATABASE_ID/backups``. - **Note**\ : Backups are not supported for Redis clusters. + **Note**\\ : Backups are not supported for Redis clusters. The result will be a JSON object with a ``backups key``. This will be set to an array of backup objects, each of which will contain the size of the backup and the timestamp at which it was created. @@ -86194,10 +90441,14 @@ async def list_backups(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86206,25 +90457,28 @@ async def list_backups(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_backups_request( + _request = build_databases_list_backups_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86261,18 +90515,19 @@ async def list_backups(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Read-only Replicas. To list all of the read-only replicas associated with a database cluster, send a GET request to ``/v2/databases/$DATABASE_ID/replicas``. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The result will be a JSON object with a ``replicas`` key. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes. @@ -86290,6 +90545,8 @@ async def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON response == { "replicas": [ { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -86313,8 +90570,6 @@ async def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON the database cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -86371,10 +90626,14 @@ async def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86383,25 +90642,28 @@ async def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_replicas_request( + _request = build_databases_list_replicas_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86438,9 +90700,9 @@ async def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_replica( @@ -86451,13 +90713,14 @@ async def create_replica( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Read-only Replica. To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to ``/v2/databases/$DATABASE_ID/replicas`` specifying the name it should be given, the size of the node to be used, and the region where it will be located. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The response will be a JSON object with a key called ``replica``. The value of this will be an object that contains the standard attributes associated with a database replica. The initial @@ -86480,6 +90743,7 @@ async def create_replica( # JSON input template you can fill out and use as your body input. body = { + "name": "str", # The name to give the read-only replicating. Required. "connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -86500,7 +90764,6 @@ async def create_replica( was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. Required. "private_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -86542,6 +90805,8 @@ async def create_replica( # response body for status code(s): 201 response == { "replica": { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -86563,8 +90828,6 @@ async def create_replica( cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -86622,18 +90885,19 @@ async def create_replica( async def create_replica( self, database_cluster_uuid: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Read-only Replica. To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to ``/v2/databases/$DATABASE_ID/replicas`` specifying the name it should be given, the size of the node to be used, and the region where it will be located. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The response will be a JSON object with a key called ``replica``. The value of this will be an object that contains the standard attributes associated with a database replica. The initial @@ -86643,7 +90907,7 @@ async def create_replica( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -86657,6 +90921,8 @@ async def create_replica( # response body for status code(s): 201 response == { "replica": { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -86678,8 +90944,6 @@ async def create_replica( cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -86737,16 +91001,17 @@ async def create_replica( async def create_replica( self, database_cluster_uuid: str, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Read-only Replica. To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to ``/v2/databases/$DATABASE_ID/replicas`` specifying the name it should be given, the size of the node to be used, and the region where it will be located. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The response will be a JSON object with a key called ``replica``. The value of this will be an object that contains the standard attributes associated with a database replica. The initial @@ -86755,11 +91020,8 @@ async def create_replica( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -86767,9 +91029,72 @@ async def create_replica( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # The name to give the read-only replicating. Required. + "connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the database cluster + was created. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a database replica. + "private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "private_network_uuid": "str", # Optional. A string specifying the UUID of + the VPC to which the read-only replica will be assigned. If excluded, the replica + will be assigned to your account's default VPC for the region. + "region": "str", # Optional. A slug identifier for the region where the + read-only replica will be located. If excluded, the replica will be placed in the + same region as the cluster. + "size": "str", # Optional. A slug identifier representing the size of the + node for the read-only replica. The size of the replica must be at least as large + as the node size for the database cluster from which it is replicating. + "status": "str", # Optional. A string representing the current status of the + database cluster. Known values are: "creating", "online", "resizing", + "migrating", and "forking". + "storage_size_mib": 0, # Optional. Additional storage added to the cluster, + in MiB. If null, no additional storage is added to the cluster, beyond what is + provided as a base amount from the 'size' and any previously added additional + storage. + "tags": [ + "str" # Optional. A flat array of tag names as strings to apply to + the read-only replica after it is created. Tag names can either be existing + or new tags. + ] + } + # response body for status code(s): 201 response == { "replica": { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -86791,8 +91116,6 @@ async def create_replica( cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -86845,10 +91168,14 @@ async def create_replica( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86857,15 +91184,15 @@ async def create_replica( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -86873,7 +91200,7 @@ async def create_replica( else: _json = None - request = build_databases_create_replica_request( + _request = build_databases_create_replica_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -86881,18 +91208,21 @@ async def create_replica( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86929,12 +91259,13 @@ async def create_replica( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_events_logs(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List all Events Logs. To list all of the cluster events, send a GET request to @@ -86978,10 +91309,14 @@ async def list_events_logs(self, database_cluster_uuid: str, **kwargs: Any) -> J tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86990,25 +91325,28 @@ async def list_events_logs(self, database_cluster_uuid: str, **kwargs: Any) -> J _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_events_logs_request( + _request = build_databases_list_events_logs_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -87045,20 +91383,21 @@ async def list_events_logs(self, database_cluster_uuid: str, **kwargs: Any) -> J deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_replica( self, database_cluster_uuid: str, replica_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Read-only Replica. To show information about an existing database replica, send a GET request to ``/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME``. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The response will be a JSON object with a ``replica key``. This will be set to an object containing the standard database replica attributes. @@ -87077,6 +91416,8 @@ async def get_replica( # response body for status code(s): 200 response == { "replica": { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -87098,8 +91439,6 @@ async def get_replica( cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -87152,10 +91491,14 @@ async def get_replica( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87164,26 +91507,29 @@ async def get_replica( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_replica_request( + _request = build_databases_get_replica_request( database_cluster_uuid=database_cluster_uuid, replica_name=replica_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -87220,20 +91566,21 @@ async def get_replica( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def destroy_replica( self, database_cluster_uuid: str, replica_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Destroy a Read-only Replica. To destroy a specific read-only replica, send a DELETE request to ``/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME``. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. @@ -87261,10 +91608,14 @@ async def destroy_replica( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87273,26 +91624,29 @@ async def destroy_replica( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_destroy_replica_request( + _request = build_databases_destroy_replica_request( database_cluster_uuid=database_cluster_uuid, replica_name=replica_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -87325,20 +91679,21 @@ async def destroy_replica( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def promote_replica( self, database_cluster_uuid: str, replica_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Promote a Read-only Replica to become a Primary Cluster. To promote a specific read-only replica, send a PUT request to ``/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME/promote``. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. @@ -87366,10 +91721,14 @@ async def promote_replica( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87378,26 +91737,29 @@ async def promote_replica( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_promote_replica_request( + _request = build_databases_promote_replica_request( database_cluster_uuid=database_cluster_uuid, replica_name=replica_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -87430,12 +91792,13 @@ async def promote_replica( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List all Database Users. To list all of the users for your database cluster, send a GET request to @@ -87461,31 +91824,28 @@ async def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: response == { "users": [ { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of - MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. Known - values are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL + 8.0, the default is ``caching_sha2_password``. Required. Known values + are: "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or "normal". + database user's role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be @@ -87494,14 +91854,17 @@ async def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: 'produceconsume' as well as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other database + rights. This option is not currently supported for other database engines. } } @@ -87519,10 +91882,14 @@ async def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87531,25 +91898,28 @@ async def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_users_request( + _request = build_databases_list_users_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -87586,9 +91956,9 @@ async def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def add_user( @@ -87599,6 +91969,7 @@ async def add_user( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a Database User. To add a new database user, send a POST request to ``/v2/databases/$DATABASE_ID/users`` @@ -87632,32 +92003,30 @@ async def add_user( # JSON input template you can fill out and use as your body input. body = { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the authentication method - to be used for connections"nto the MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If excluded when - creating a new user, the"ndefault for the version of MySQL in use will be - used. As of MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. + to be used for connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If excluded when + creating a new user, the default for the version of MySQL in use will be + used. As of MySQL 8.0, the default is ``caching_sha2_password``. Required. Known values are: "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "readonly": bool, # Optional. For MongoDB clusters, set to ``true`` to - create a read-only user."nThis option is not currently supported for other + create a read-only user. This option is not currently supported for other database engines. "role": "str", # Optional. A string representing the database user's role. - The value will be either"n"primary" or "normal". Known values are: "primary" and + The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for the ACL. - Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to the topic. @@ -87665,12 +92034,14 @@ async def add_user( 'admin' allows for 'produceconsume' as well as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the topic(s) + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for the ACL. + Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights."nThis option is not currently + to ``true`` for a user with replication rights. This option is not currently supported for other database engines. } } @@ -87678,30 +92049,28 @@ async def add_user( # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -87710,13 +92079,15 @@ async def add_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -87737,11 +92108,12 @@ async def add_user( async def add_user( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a Database User. To add a new database user, send a POST request to ``/v2/databases/$DATABASE_ID/users`` @@ -87762,7 +92134,7 @@ async def add_user( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -87776,30 +92148,28 @@ async def add_user( # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -87808,13 +92178,15 @@ async def add_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -87833,8 +92205,9 @@ async def add_user( @distributed_trace_async async def add_user( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a Database User. To add a new database user, send a POST request to ``/v2/databases/$DATABASE_ID/users`` @@ -87854,11 +92227,8 @@ async def add_user( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -87866,33 +92236,76 @@ async def add_user( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # The name of a database user. Required. + "access_cert": "str", # Optional. Access certificate for TLS client + authentication. (Kafka only). + "access_key": "str", # Optional. Access key for TLS client authentication. + (Kafka only). + "mysql_settings": { + "auth_plugin": "str" # A string specifying the authentication method + to be used for connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If excluded when + creating a new user, the default for the version of MySQL in use will be + used. As of MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and "caching_sha2_password". + }, + "password": "str", # Optional. A randomly generated password for the + database user. + "readonly": bool, # Optional. For MongoDB clusters, set to ``true`` to + create a read-only user. This option is not currently supported for other + database engines. + "role": "str", # Optional. A string representing the database user's role. + The value will be either "primary" or "normal". Known values are: "primary" and + "normal". + "settings": { + "acl": [ + { + "permission": "str", # Permission set applied to the + ACL. 'consume' allows for messages to be consumed from the topic. + 'produce' allows for messages to be published to the topic. + 'produceconsume' allows for both 'consume' and 'produce' permission. + 'admin' allows for 'produceconsume' as well as any operations to + administer the topic (delete, update). Required. Known values are: + "admin", "consume", "produce", and "produceconsume". + "topic": "str", # A regex for matching the topic(s) + that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for the ACL. + Will be computed after the ACL is created/updated. + } + ], + "pg_allow_replication": bool # Optional. For Postgres clusters, set + to ``true`` for a user with replication rights. This option is not currently + supported for other database engines. + } + } + # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -87901,13 +92314,15 @@ async def add_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -87923,10 +92338,14 @@ async def add_user( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87935,20 +92354,20 @@ async def add_user( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_add_user_request( + _request = build_databases_add_user_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -87956,18 +92375,21 @@ async def add_user( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88004,14 +92426,15 @@ async def add_user( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_user( self, database_cluster_uuid: str, username: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Database User. To show information about an existing database user, send a GET request to @@ -88041,30 +92464,28 @@ async def get_user( # response body for status code(s): 200 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -88073,13 +92494,15 @@ async def get_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -88095,10 +92518,14 @@ async def get_user( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88107,26 +92534,29 @@ async def get_user( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_user_request( + _request = build_databases_get_user_request( database_cluster_uuid=database_cluster_uuid, username=username, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88163,14 +92593,15 @@ async def get_user( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_user( self, database_cluster_uuid: str, username: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove a Database User. To remove a specific database user, send a DELETE request to @@ -88204,10 +92635,14 @@ async def delete_user( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88216,26 +92651,29 @@ async def delete_user( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_user_request( + _request = build_databases_delete_user_request( database_cluster_uuid=database_cluster_uuid, username=username, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -88268,9 +92706,9 @@ async def delete_user( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def update_user( @@ -88282,13 +92720,14 @@ async def update_user( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Database User. To update an existing database user, send a PUT request to ``/v2/databases/$DATABASE_ID/users/$USERNAME`` with the desired settings. - **Note**\ : only ``settings`` can be updated via this type of request. If you wish to change + **Note**\\ : only ``settings`` can be updated via this type of request. If you wish to change the name of a user, you must recreate a new user. @@ -88318,8 +92757,6 @@ async def update_user( "settings": { "acl": [ { - "id": "str", # Optional. An identifier for the ACL. - Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to the topic. @@ -88327,12 +92764,14 @@ async def update_user( 'admin' allows for 'produceconsume' as well as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the topic(s) + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for the ACL. + Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights."nThis option is not currently + to ``true`` for a user with replication rights. This option is not currently supported for other database engines. } } @@ -88340,30 +92779,28 @@ async def update_user( # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -88372,13 +92809,15 @@ async def update_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -88400,18 +92839,19 @@ async def update_user( self, database_cluster_uuid: str, username: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Database User. To update an existing database user, send a PUT request to ``/v2/databases/$DATABASE_ID/users/$USERNAME`` with the desired settings. - **Note**\ : only ``settings`` can be updated via this type of request. If you wish to change + **Note**\\ : only ``settings`` can be updated via this type of request. If you wish to change the name of a user, you must recreate a new user. @@ -88425,7 +92865,7 @@ async def update_user( :param username: The name of the database user. Required. :type username: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -88439,30 +92879,28 @@ async def update_user( # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -88471,13 +92909,15 @@ async def update_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -88499,16 +92939,17 @@ async def update_user( self, database_cluster_uuid: str, username: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Database User. To update an existing database user, send a PUT request to ``/v2/databases/$DATABASE_ID/users/$USERNAME`` with the desired settings. - **Note**\ : only ``settings`` can be updated via this type of request. If you wish to change + **Note**\\ : only ``settings`` can be updated via this type of request. If you wish to change the name of a user, you must recreate a new user. @@ -88521,11 +92962,8 @@ async def update_user( :type database_cluster_uuid: str :param username: The name of the database user. Required. :type username: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -88533,33 +92971,55 @@ async def update_user( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "settings": { + "acl": [ + { + "permission": "str", # Permission set applied to the + ACL. 'consume' allows for messages to be consumed from the topic. + 'produce' allows for messages to be published to the topic. + 'produceconsume' allows for both 'consume' and 'produce' permission. + 'admin' allows for 'produceconsume' as well as any operations to + administer the topic (delete, update). Required. Known values are: + "admin", "consume", "produce", and "produceconsume". + "topic": "str", # A regex for matching the topic(s) + that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for the ACL. + Will be computed after the ACL is created/updated. + } + ], + "pg_allow_replication": bool # Optional. For Postgres clusters, set + to ``true`` for a user with replication rights. This option is not currently + supported for other database engines. + } + } + # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -88568,13 +93028,15 @@ async def update_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -88590,10 +93052,14 @@ async def update_user( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88602,20 +93068,20 @@ async def update_user( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_user_request( + _request = build_databases_update_user_request( database_cluster_uuid=database_cluster_uuid, username=username, content_type=content_type, @@ -88624,18 +93090,21 @@ async def update_user( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88672,9 +93141,9 @@ async def update_user( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def reset_auth( @@ -88686,6 +93155,7 @@ async def reset_auth( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Reset a Database User's Password or Authentication Method. To reset the password for a database user, send a POST request to @@ -88718,10 +93188,10 @@ async def reset_auth( body = { "mysql_settings": { "auth_plugin": "str" # A string specifying the authentication method - to be used for connections"nto the MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If excluded when - creating a new user, the"ndefault for the version of MySQL in use will be - used. As of MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. + to be used for connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If excluded when + creating a new user, the default for the version of MySQL in use will be + used. As of MySQL 8.0, the default is ``caching_sha2_password``. Required. Known values are: "mysql_native_password" and "caching_sha2_password". } } @@ -88729,30 +93199,28 @@ async def reset_auth( # response body for status code(s): 200 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -88761,13 +93229,15 @@ async def reset_auth( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -88789,11 +93259,12 @@ async def reset_auth( self, database_cluster_uuid: str, username: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Reset a Database User's Password or Authentication Method. To reset the password for a database user, send a POST request to @@ -88811,7 +93282,7 @@ async def reset_auth( :param username: The name of the database user. Required. :type username: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -88825,30 +93296,28 @@ async def reset_auth( # response body for status code(s): 200 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -88857,13 +93326,15 @@ async def reset_auth( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -88885,9 +93356,10 @@ async def reset_auth( self, database_cluster_uuid: str, username: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Reset a Database User's Password or Authentication Method. To reset the password for a database user, send a POST request to @@ -88904,11 +93376,8 @@ async def reset_auth( :type database_cluster_uuid: str :param username: The name of the database user. Required. :type username: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -88916,33 +93385,43 @@ async def reset_auth( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "mysql_settings": { + "auth_plugin": "str" # A string specifying the authentication method + to be used for connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If excluded when + creating a new user, the default for the version of MySQL in use will be + used. As of MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and "caching_sha2_password". + } + } + # response body for status code(s): 200 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -88951,13 +93430,15 @@ async def reset_auth( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -88973,10 +93454,14 @@ async def reset_auth( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88985,20 +93470,20 @@ async def reset_auth( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_reset_auth_request( + _request = build_databases_reset_auth_request( database_cluster_uuid=database_cluster_uuid, username=username, content_type=content_type, @@ -89007,18 +93492,21 @@ async def reset_auth( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -89055,12 +93543,13 @@ async def reset_auth( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Databases. To list all of the databases in a clusters, send a GET request to @@ -89100,10 +93589,14 @@ async def list(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -89112,25 +93605,28 @@ async def list(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_request( + _request = build_databases_list_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -89167,9 +93663,9 @@ async def list(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def add( @@ -89180,6 +93676,7 @@ async def add( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a New Database. To add a new database to an existing cluster, send a POST request to @@ -89232,11 +93729,12 @@ async def add( async def add( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a New Database. To add a new database to an existing cluster, send a POST request to @@ -89250,7 +93748,7 @@ async def add( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -89282,8 +93780,9 @@ async def add( @distributed_trace_async async def add( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a New Database. To add a new database to an existing cluster, send a POST request to @@ -89296,11 +93795,8 @@ async def add( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -89308,6 +93804,11 @@ async def add( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # The name of the database. Required. + } + # response body for status code(s): 201 response == { "db": { @@ -89326,10 +93827,14 @@ async def add( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -89338,20 +93843,20 @@ async def add( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_add_request( + _request = build_databases_add_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -89359,18 +93864,21 @@ async def add( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -89407,14 +93915,15 @@ async def add( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get( self, database_cluster_uuid: str, database_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Database. To show information about an existing database cluster, send a GET request to @@ -89454,10 +93963,14 @@ async def get( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -89466,26 +93979,29 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_request( + _request = build_databases_get_request( database_cluster_uuid=database_cluster_uuid, database_name=database_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -89522,14 +94038,15 @@ async def get( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete( self, database_cluster_uuid: str, database_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Database. To delete a specific database, send a DELETE request to @@ -89563,10 +94080,14 @@ async def delete( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -89575,26 +94096,29 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_request( + _request = build_databases_delete_request( database_cluster_uuid=database_cluster_uuid, database_name=database_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -89627,14 +94151,15 @@ async def delete( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_connection_pools( self, database_cluster_uuid: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Connection Pools (PostgreSQL). To list all of the connection pools available to a PostgreSQL database cluster, send a GET @@ -89655,6 +94180,20 @@ async def list_connection_pools( response == { "pools": [ { + "db": "str", # The database for use with the connection + pool. Required. + "mode": "str", # The PGBouncer transaction mode for the + connection pool. The allowed values are session, transaction, and + statement. Required. + "name": "str", # A unique name for the connection pool. Must + be between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection + pool. The maximum allowed size is determined by the size of the cluster's + primary node. 25 backend server connections are allowed for every 1GB of + RAM. Three are reserved for maintenance. For example, a primary node with + 1 GB of RAM allows for a maximum of 22 backend server connections while + one with 4 GB would allow for 97. Note that these are shared across all + connection pools in a cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -89673,13 +94212,6 @@ async def list_connection_pools( "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection - pool. Required. - "mode": "str", # The PGBouncer transaction mode for the - connection pool. The allowed values are session, transaction, and - statement. Required. - "name": "str", # A unique name for the connection pool. Must - be between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -89698,13 +94230,6 @@ async def list_connection_pools( "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection - pool. The maximum allowed size is determined by the size of the cluster's - primary node. 25 backend server connections are allowed for every 1GB of - RAM. Three are reserved for maintenance. For example, a primary node with - 1 GB of RAM allows for a maximum of 22 backend server connections while - one with 4 GB would allow for 97. Note that these are shared across all - connection pools in a cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -89759,10 +94284,14 @@ async def list_connection_pools( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -89771,25 +94300,28 @@ async def list_connection_pools( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_connection_pools_request( + _request = build_databases_list_connection_pools_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -89826,9 +94358,9 @@ async def list_connection_pools( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def add_connection_pool( @@ -89839,6 +94371,7 @@ async def add_connection_pool( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a New Connection Pool (PostgreSQL). For PostgreSQL database clusters, connection pools can be used to allow a @@ -89869,6 +94402,17 @@ async def add_connection_pool( # JSON input template you can fill out and use as your body input. body = { + "db": "str", # The database for use with the connection pool. Required. + "mode": "str", # The PGBouncer transaction mode for the connection pool. The + allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be between 3 + and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The maximum + allowed size is determined by the size of the cluster's primary node. 25 backend + server connections are allowed for every 1GB of RAM. Three are reserved for + maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of + 22 backend server connections while one with 4 GB would allow for 97. Note that + these are shared across all connection pools in a cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -89884,11 +94428,6 @@ async def add_connection_pool( to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. Required. - "mode": "str", # The PGBouncer transaction mode for the connection pool. The - allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be between 3 - and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -89904,12 +94443,6 @@ async def add_connection_pool( to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The maximum - allowed size is determined by the size of the cluster's primary node. 25 backend - server connections are allowed for every 1GB of RAM. Three are reserved for - maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of - 22 backend server connections while one with 4 GB would allow for 97. Note that - these are shared across all connection pools in a cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -89947,6 +94480,19 @@ async def add_connection_pool( # response body for status code(s): 201 response == { "pool": { + "db": "str", # The database for use with the connection pool. + Required. + "mode": "str", # The PGBouncer transaction mode for the connection + pool. The allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be + between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The + maximum allowed size is determined by the size of the cluster's primary node. + 25 backend server connections are allowed for every 1GB of RAM. Three are + reserved for maintenance. For example, a primary node with 1 GB of RAM allows + for a maximum of 22 backend server connections while one with 4 GB would + allow for 97. Note that these are shared across all connection pools in a + cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -89963,12 +94509,6 @@ async def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. - Required. - "mode": "str", # The PGBouncer transaction mode for the connection - pool. The allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be - between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -89985,13 +94525,6 @@ async def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The - maximum allowed size is determined by the size of the cluster's primary node. - 25 backend server connections are allowed for every 1GB of RAM. Three are - reserved for maintenance. For example, a primary node with 1 GB of RAM allows - for a maximum of 22 backend server connections while one with 4 GB would - allow for 97. Note that these are shared across all connection pools in a - cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -90046,11 +94579,12 @@ async def add_connection_pool( async def add_connection_pool( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a New Connection Pool (PostgreSQL). For PostgreSQL database clusters, connection pools can be used to allow a @@ -90068,7 +94602,7 @@ async def add_connection_pool( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -90082,6 +94616,19 @@ async def add_connection_pool( # response body for status code(s): 201 response == { "pool": { + "db": "str", # The database for use with the connection pool. + Required. + "mode": "str", # The PGBouncer transaction mode for the connection + pool. The allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be + between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The + maximum allowed size is determined by the size of the cluster's primary node. + 25 backend server connections are allowed for every 1GB of RAM. Three are + reserved for maintenance. For example, a primary node with 1 GB of RAM allows + for a maximum of 22 backend server connections while one with 4 GB would + allow for 97. Note that these are shared across all connection pools in a + cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -90098,12 +94645,6 @@ async def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. - Required. - "mode": "str", # The PGBouncer transaction mode for the connection - pool. The allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be - between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -90120,13 +94661,6 @@ async def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The - maximum allowed size is determined by the size of the cluster's primary node. - 25 backend server connections are allowed for every 1GB of RAM. Three are - reserved for maintenance. For example, a primary node with 1 GB of RAM allows - for a maximum of 22 backend server connections while one with 4 GB would - allow for 97. Note that these are shared across all connection pools in a - cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -90179,8 +94713,9 @@ async def add_connection_pool( @distributed_trace_async async def add_connection_pool( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a New Connection Pool (PostgreSQL). For PostgreSQL database clusters, connection pools can be used to allow a @@ -90197,11 +94732,8 @@ async def add_connection_pool( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -90209,9 +94741,99 @@ async def add_connection_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "db": "str", # The database for use with the connection pool. Required. + "mode": "str", # The PGBouncer transaction mode for the connection pool. The + allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be between 3 + and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The maximum + allowed size is determined by the size of the cluster's primary node. 25 backend + server connections are allowed for every 1GB of RAM. Three are reserved for + maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of + 22 backend server connections while one with 4 GB would allow for 97. Note that + these are shared across all connection pools in a cluster. Required. + "connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "standby_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "standby_private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "user": "str" # Optional. The name of the user for use with the connection + pool. When excluded, all sessions connect to the database as the inbound user. + } + # response body for status code(s): 201 response == { "pool": { + "db": "str", # The database for use with the connection pool. + Required. + "mode": "str", # The PGBouncer transaction mode for the connection + pool. The allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be + between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The + maximum allowed size is determined by the size of the cluster's primary node. + 25 backend server connections are allowed for every 1GB of RAM. Three are + reserved for maintenance. For example, a primary node with 1 GB of RAM allows + for a maximum of 22 backend server connections while one with 4 GB would + allow for 97. Note that these are shared across all connection pools in a + cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -90228,12 +94850,6 @@ async def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. - Required. - "mode": "str", # The PGBouncer transaction mode for the connection - pool. The allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be - between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -90250,13 +94866,6 @@ async def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The - maximum allowed size is determined by the size of the cluster's primary node. - 25 backend server connections are allowed for every 1GB of RAM. Three are - reserved for maintenance. For example, a primary node with 1 GB of RAM allows - for a maximum of 22 backend server connections while one with 4 GB would - allow for 97. Note that these are shared across all connection pools in a - cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -90306,10 +94915,14 @@ async def add_connection_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -90318,20 +94931,20 @@ async def add_connection_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_add_connection_pool_request( + _request = build_databases_add_connection_pool_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -90339,18 +94952,21 @@ async def add_connection_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -90387,14 +95003,15 @@ async def add_connection_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_connection_pool( self, database_cluster_uuid: str, pool_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Existing Connection Pool (PostgreSQL). To show information about an existing connection pool for a PostgreSQL database cluster, send a @@ -90415,6 +95032,19 @@ async def get_connection_pool( # response body for status code(s): 200 response == { "pool": { + "db": "str", # The database for use with the connection pool. + Required. + "mode": "str", # The PGBouncer transaction mode for the connection + pool. The allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be + between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The + maximum allowed size is determined by the size of the cluster's primary node. + 25 backend server connections are allowed for every 1GB of RAM. Three are + reserved for maintenance. For example, a primary node with 1 GB of RAM allows + for a maximum of 22 backend server connections while one with 4 GB would + allow for 97. Note that these are shared across all connection pools in a + cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -90431,12 +95061,6 @@ async def get_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. - Required. - "mode": "str", # The PGBouncer transaction mode for the connection - pool. The allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be - between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -90453,13 +95077,6 @@ async def get_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The - maximum allowed size is determined by the size of the cluster's primary node. - 25 backend server connections are allowed for every 1GB of RAM. Three are - reserved for maintenance. For example, a primary node with 1 GB of RAM allows - for a maximum of 22 backend server connections while one with 4 GB would - allow for 97. Note that these are shared across all connection pools in a - cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -90509,10 +95126,14 @@ async def get_connection_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -90521,26 +95142,29 @@ async def get_connection_pool( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_connection_pool_request( + _request = build_databases_get_connection_pool_request( database_cluster_uuid=database_cluster_uuid, pool_name=pool_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -90577,9 +95201,9 @@ async def get_connection_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_connection_pool( @@ -90591,6 +95215,7 @@ async def update_connection_pool( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Connection Pools (PostgreSQL). To update a connection pool for a PostgreSQL database cluster, send a PUT request to @@ -90645,11 +95270,12 @@ async def update_connection_pool( self, database_cluster_uuid: str, pool_name: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Connection Pools (PostgreSQL). To update a connection pool for a PostgreSQL database cluster, send a PUT request to @@ -90660,7 +95286,7 @@ async def update_connection_pool( :param pool_name: The name used to identify the connection pool. Required. :type pool_name: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -90689,9 +95315,10 @@ async def update_connection_pool( self, database_cluster_uuid: str, pool_name: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Connection Pools (PostgreSQL). To update a connection pool for a PostgreSQL database cluster, send a PUT request to @@ -90701,11 +95328,8 @@ async def update_connection_pool( :type database_cluster_uuid: str :param pool_name: The name used to identify the connection pool. Required. :type pool_name: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -90713,6 +95337,21 @@ async def update_connection_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "db": "str", # The database for use with the connection pool. Required. + "mode": "str", # The PGBouncer transaction mode for the connection pool. The + allowed values are session, transaction, and statement. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The maximum + allowed size is determined by the size of the cluster's primary node. 25 backend + server connections are allowed for every 1GB of RAM. Three are reserved for + maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of + 22 backend server connections while one with 4 GB would allow for 97. Note that + these are shared across all connection pools in a cluster. Required. + "user": "str" # Optional. The name of the user for use with the connection + pool. When excluded, all sessions connect to the database as the inbound user. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -90725,10 +95364,14 @@ async def update_connection_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -90737,20 +95380,20 @@ async def update_connection_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_connection_pool_request( + _request = build_databases_update_connection_pool_request( database_cluster_uuid=database_cluster_uuid, pool_name=pool_name, content_type=content_type, @@ -90759,18 +95402,21 @@ async def update_connection_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -90803,14 +95449,15 @@ async def update_connection_pool( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def delete_connection_pool( self, database_cluster_uuid: str, pool_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Connection Pool (PostgreSQL). To delete a specific connection pool for a PostgreSQL database cluster, send @@ -90842,10 +95489,14 @@ async def delete_connection_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -90854,26 +95505,29 @@ async def delete_connection_pool( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_connection_pool_request( + _request = build_databases_delete_connection_pool_request( database_cluster_uuid=database_cluster_uuid, pool_name=pool_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -90906,14 +95560,15 @@ async def delete_connection_pool( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_eviction_policy( self, database_cluster_uuid: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve the Eviction Policy for a Redis Cluster. To retrieve the configured eviction policy for an existing Redis cluster, send a GET request to @@ -90933,12 +95588,12 @@ async def get_eviction_policy( # response body for status code(s): 200 response == { "eviction_policy": "str" # A string specifying the desired eviction policy - for the Redis cluster."n"n"n* ``noeviction``"" : Don't evict any data, returns - error when memory limit is reached."n* ``allkeys_lru:`` Evict any key, least - recently used (LRU) first."n* ``allkeys_random``"" : Evict keys in a random - order."n* ``volatile_lru``"" : Evict keys with expiration only, least recently - used (LRU) first."n* ``volatile_random``"" : Evict keys with expiration only in a - random order."n* ``volatile_ttl``"" : Evict keys with expiration only, shortest + for the Redis cluster. * ``noeviction``"" : Don't evict any data, returns error + when memory limit is reached. * ``allkeys_lru:`` Evict any key, least recently + used (LRU) first. * ``allkeys_random``"" : Evict keys in a random order. * + ``volatile_lru``"" : Evict keys with expiration only, least recently used (LRU) + first. * ``volatile_random``"" : Evict keys with expiration only in a random + order. * ``volatile_ttl``"" : Evict keys with expiration only, shortest time-to-live (TTL) first. Required. Known values are: "noeviction", "allkeys_lru", "allkeys_random", "volatile_lru", "volatile_random", and "volatile_ttl". @@ -90955,10 +95610,14 @@ async def get_eviction_policy( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -90967,25 +95626,28 @@ async def get_eviction_policy( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_eviction_policy_request( + _request = build_databases_get_eviction_policy_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -91022,9 +95684,9 @@ async def get_eviction_policy( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_eviction_policy( @@ -91035,6 +95697,7 @@ async def update_eviction_policy( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure the Eviction Policy for a Redis Cluster. To configure an eviction policy for an existing Redis cluster, send a PUT request to @@ -91057,12 +95720,12 @@ async def update_eviction_policy( # JSON input template you can fill out and use as your body input. body = { "eviction_policy": "str" # A string specifying the desired eviction policy - for the Redis cluster."n"n"n* ``noeviction``"" : Don't evict any data, returns - error when memory limit is reached."n* ``allkeys_lru:`` Evict any key, least - recently used (LRU) first."n* ``allkeys_random``"" : Evict keys in a random - order."n* ``volatile_lru``"" : Evict keys with expiration only, least recently - used (LRU) first."n* ``volatile_random``"" : Evict keys with expiration only in a - random order."n* ``volatile_ttl``"" : Evict keys with expiration only, shortest + for the Redis cluster. * ``noeviction``"" : Don't evict any data, returns error + when memory limit is reached. * ``allkeys_lru:`` Evict any key, least recently + used (LRU) first. * ``allkeys_random``"" : Evict keys in a random order. * + ``volatile_lru``"" : Evict keys with expiration only, least recently used (LRU) + first. * ``volatile_random``"" : Evict keys with expiration only in a random + order. * ``volatile_ttl``"" : Evict keys with expiration only, shortest time-to-live (TTL) first. Required. Known values are: "noeviction", "allkeys_lru", "allkeys_random", "volatile_lru", "volatile_random", and "volatile_ttl". @@ -91085,11 +95748,12 @@ async def update_eviction_policy( async def update_eviction_policy( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure the Eviction Policy for a Redis Cluster. To configure an eviction policy for an existing Redis cluster, send a PUT request to @@ -91098,7 +95762,7 @@ async def update_eviction_policy( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -91124,8 +95788,9 @@ async def update_eviction_policy( @distributed_trace_async async def update_eviction_policy( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure the Eviction Policy for a Redis Cluster. To configure an eviction policy for an existing Redis cluster, send a PUT request to @@ -91133,11 +95798,8 @@ async def update_eviction_policy( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -91145,6 +95807,20 @@ async def update_eviction_policy( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "eviction_policy": "str" # A string specifying the desired eviction policy + for the Redis cluster. * ``noeviction``"" : Don't evict any data, returns error + when memory limit is reached. * ``allkeys_lru:`` Evict any key, least recently + used (LRU) first. * ``allkeys_random``"" : Evict keys in a random order. * + ``volatile_lru``"" : Evict keys with expiration only, least recently used (LRU) + first. * ``volatile_random``"" : Evict keys with expiration only in a random + order. * ``volatile_ttl``"" : Evict keys with expiration only, shortest + time-to-live (TTL) first. Required. Known values are: "noeviction", + "allkeys_lru", "allkeys_random", "volatile_lru", "volatile_random", and + "volatile_ttl". + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -91157,10 +95833,14 @@ async def update_eviction_policy( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91169,20 +95849,20 @@ async def update_eviction_policy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_eviction_policy_request( + _request = build_databases_update_eviction_policy_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -91190,18 +95870,21 @@ async def update_eviction_policy( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -91234,12 +95917,13 @@ async def update_eviction_policy( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_sql_mode(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve the SQL Modes for a MySQL Cluster. To retrieve the configured SQL modes for an existing MySQL cluster, send a GET request to @@ -91273,10 +95957,14 @@ async def get_sql_mode(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91285,25 +95973,28 @@ async def get_sql_mode(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_sql_mode_request( + _request = build_databases_get_sql_mode_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -91340,9 +96031,9 @@ async def get_sql_mode(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_sql_mode( @@ -91353,6 +96044,7 @@ async def update_sql_mode( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update SQL Mode for a Cluster. To configure the SQL modes for an existing MySQL cluster, send a PUT request to @@ -91398,11 +96090,12 @@ async def update_sql_mode( async def update_sql_mode( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update SQL Mode for a Cluster. To configure the SQL modes for an existing MySQL cluster, send a PUT request to @@ -91414,7 +96107,7 @@ async def update_sql_mode( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -91440,8 +96133,9 @@ async def update_sql_mode( @distributed_trace_async async def update_sql_mode( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update SQL Mode for a Cluster. To configure the SQL modes for an existing MySQL cluster, send a PUT request to @@ -91452,11 +96146,8 @@ async def update_sql_mode( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -91464,6 +96155,12 @@ async def update_sql_mode( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "sql_mode": "str" # A string specifying the configured SQL modes for the + MySQL cluster. Required. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -91476,10 +96173,14 @@ async def update_sql_mode( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91488,20 +96189,20 @@ async def update_sql_mode( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_sql_mode_request( + _request = build_databases_update_sql_mode_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -91509,18 +96210,21 @@ async def update_sql_mode( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -91553,9 +96257,9 @@ async def update_sql_mode( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def update_major_version( @@ -91566,10 +96270,11 @@ async def update_major_version( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade Major Version for a Database. To upgrade the major version of a database, send a PUT request to - ``/v2/databases/$DATABASE_ID/upgrade``\ , specifying the target version. + ``/v2/databases/$DATABASE_ID/upgrade``\\ , specifying the target version. A successful request will receive a 204 No Content status code with no body in response. :param database_cluster_uuid: A unique identifier for a database cluster. Required. @@ -91609,21 +96314,22 @@ async def update_major_version( async def update_major_version( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade Major Version for a Database. To upgrade the major version of a database, send a PUT request to - ``/v2/databases/$DATABASE_ID/upgrade``\ , specifying the target version. + ``/v2/databases/$DATABASE_ID/upgrade``\\ , specifying the target version. A successful request will receive a 204 No Content status code with no body in response. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -91649,21 +96355,19 @@ async def update_major_version( @distributed_trace_async async def update_major_version( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade Major Version for a Database. To upgrade the major version of a database, send a PUT request to - ``/v2/databases/$DATABASE_ID/upgrade``\ , specifying the target version. + ``/v2/databases/$DATABASE_ID/upgrade``\\ , specifying the target version. A successful request will receive a 204 No Content status code with no body in response. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -91671,6 +96375,12 @@ async def update_major_version( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "version": "str" # Optional. A string representing the version of the + database engine in use for the cluster. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -91683,10 +96393,14 @@ async def update_major_version( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91695,20 +96409,20 @@ async def update_major_version( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_major_version_request( + _request = build_databases_update_major_version_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -91716,18 +96430,21 @@ async def update_major_version( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -91760,14 +96477,15 @@ async def update_major_version( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_kafka_topics( self, database_cluster_uuid: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Topics for a Kafka Cluster. To list all of a Kafka cluster's topics, send a GET request to @@ -91810,10 +96528,14 @@ async def list_kafka_topics( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91822,25 +96544,28 @@ async def list_kafka_topics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_kafka_topics_request( + _request = build_databases_list_kafka_topics_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -91877,9 +96602,9 @@ async def list_kafka_topics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_kafka_topic( @@ -91890,6 +96615,7 @@ async def create_kafka_topic( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Topic for a Kafka Cluster. To create a topic attached to a Kafka cluster, send a POST request to @@ -92147,11 +96873,12 @@ async def create_kafka_topic( async def create_kafka_topic( self, database_cluster_uuid: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Topic for a Kafka Cluster. To create a topic attached to a Kafka cluster, send a POST request to @@ -92162,7 +96889,7 @@ async def create_kafka_topic( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -92314,9 +97041,10 @@ async def create_kafka_topic( async def create_kafka_topic( self, database_cluster_uuid: str, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Topic for a Kafka Cluster. To create a topic attached to a Kafka cluster, send a POST request to @@ -92326,11 +97054,8 @@ async def create_kafka_topic( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -92338,6 +97063,101 @@ async def create_kafka_topic( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "config": { + "cleanup_policy": "delete", # Optional. Default value is "delete". + The cleanup_policy sets the retention policy to use on log segments. 'delete' + will discard old segments when retention time/size limits are reached. + 'compact' will enable log compaction, resulting in retention of the latest + value for each key. Known values are: "delete", "compact", and + "compact_delete". + "compression_type": "producer", # Optional. Default value is + "producer". The compression_type specifies the compression type of the topic. + Known values are: "producer", "gzip", "snappy", "Iz4", "zstd", and + "uncompressed". + "delete_retention_ms": 86400000, # Optional. Default value is + 86400000. The delete_retention_ms specifies how long (in ms) to retain delete + tombstone markers for topics. + "file_delete_delay_ms": 60000, # Optional. Default value is 60000. + The file_delete_delay_ms specifies the time (in ms) to wait before deleting a + file from the filesystem. + "flush_messages": 9223372036854776000, # Optional. Default value is + 9223372036854776000. The flush_messages specifies the number of messages to + accumulate on a log partition before messages are flushed to disk. + "flush_ms": 9223372036854776000, # Optional. Default value is + 9223372036854776000. The flush_ms specifies the maximum time (in ms) that a + message is kept in memory before being flushed to disk. + "index_interval_bytes": 4096, # Optional. Default value is 4096. The + index_interval_bytes specifies the number of bytes between entries being + added into te offset index. + "max_compaction_lag_ms": 9223372036854776000, # Optional. Default + value is 9223372036854776000. The max_compaction_lag_ms specifies the maximum + amount of time (in ms) that a message will remain uncompacted. This is only + applicable if the logs are have compaction enabled. + "max_message_bytes": 1048588, # Optional. Default value is 1048588. + The max_messages_bytes specifies the largest record batch size (in bytes) + that can be sent to the server. This is calculated after compression if + compression is enabled. + "message_down_conversion_enable": True, # Optional. Default value is + True. The message_down_conversion_enable specifies whether down-conversion of + message formats is enabled to satisfy consumer requests. When 'false', the + broker will not perform conversion for consumers expecting older message + formats. The broker will respond with an ``UNSUPPORTED_VERSION`` error for + consume requests from these older clients. + "message_format_version": "3.0-IV1", # Optional. Default value is + "3.0-IV1". The message_format_version specifies the message format version + used by the broker to append messages to the logs. The value of this setting + is assumed to be 3.0-IV1 if the broker protocol version is 3.0 or higher. By + setting a particular message format version, all existing messages on disk + must be smaller or equal to the specified version. Known values are: "0.8.0", + "0.8.1", "0.8.2", "0.9.0", "0.10.0-IV0", "0.10.0-IV1", "0.10.1-IV0", + "0.10.1-IV1", "0.10.1-IV2", "0.10.2-IV0", "0.11.0-IV0", "0.11.0-IV1", + "0.11.0-IV2", "1.0-IV0", "1.1-IV0", "2.0-IV0", "2.0-IV1", "2.1-IV0", + "2.1-IV1", "2.1-IV2", "2.2-IV0", "2.2-IV1", "2.3-IV0", "2.3-IV1", "2.4-IV0", + "2.4-IV1", "2.5-IV0", "2.6-IV0", "2.7-IV0", "2.7-IV1", "2.7-IV2", "2.8-IV0", + "2.8-IV1", "3.0-IV0", "3.0-IV1", "3.1-IV0", "3.2-IV0", "3.3-IV0", "3.3-IV1", + "3.3-IV2", and "3.3-IV3". + "message_timestamp_type": "create_time", # Optional. Default value + is "create_time". The message_timestamp_type specifies whether to use the + message create time or log append time as the timestamp on a message. Known + values are: "create_time" and "log_append_time". + "min_cleanable_dirty_ratio": 0.5, # Optional. Default value is 0.5. + The min_cleanable_dirty_ratio specifies the frequency of log compaction (if + enabled) in relation to duplicates present in the logs. For example, at 0.5, + at most 50% of the log could be duplicates before compaction would begin. + "min_compaction_lag_ms": 0, # Optional. Default value is 0. The + min_compaction_lag_ms specifies the minimum time (in ms) that a message will + remain uncompacted in the log. Only relevant if log compaction is enabled. + "min_insync_replicas": 1, # Optional. Default value is 1. The + min_insync_replicas specifies the number of replicas that must ACK a write + for the write to be considered successful. + "preallocate": False, # Optional. Default value is False. The + preallocate specifies whether a file should be preallocated on disk when + creating a new log segment. + "retention_bytes": -1, # Optional. Default value is -1. The + retention_bytes specifies the maximum size of the log (in bytes) before + deleting messages. -1 indicates that there is no limit. + "retention_ms": 604800000, # Optional. Default value is 604800000. + The retention_ms specifies the maximum amount of time (in ms) to keep a + message before deleting it. + "segment_bytes": 209715200, # Optional. Default value is 209715200. + The segment_bytes specifies the maximum size of a single log file (in bytes). + "segment_jitter_ms": 0, # Optional. Default value is 0. The + segment_jitter_ms specifies the maximum random jitter subtracted from the + scheduled segment roll time to avoid thundering herds of segment rolling. + "segment_ms": 604800000 # Optional. Default value is 604800000. The + segment_ms specifies the period of time after which the log will be forced to + roll if the segment file isn't full. This ensures that retention can delete + or compact old data. + }, + "name": "str", # Optional. The name of the Kafka topic. + "partition_count": 0, # Optional. The number of partitions available for the + topic. On update, this value can only be increased. + "replication_factor": 0 # Optional. The number of nodes to replicate data + across the cluster. + } + # response body for status code(s): 201 response == { "topic": { @@ -92474,10 +97294,14 @@ async def create_kafka_topic( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -92486,15 +97310,15 @@ async def create_kafka_topic( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -92502,7 +97326,7 @@ async def create_kafka_topic( else: _json = None - request = build_databases_create_kafka_topic_request( + _request = build_databases_create_kafka_topic_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -92510,18 +97334,21 @@ async def create_kafka_topic( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -92558,14 +97385,15 @@ async def create_kafka_topic( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_kafka_topic( self, database_cluster_uuid: str, topic_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Get Topic for a Kafka Cluster. To retrieve a given topic by name from the set of a Kafka cluster's topics, @@ -92720,10 +97548,14 @@ async def get_kafka_topic( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -92732,26 +97564,29 @@ async def get_kafka_topic( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_kafka_topic_request( + _request = build_databases_get_kafka_topic_request( database_cluster_uuid=database_cluster_uuid, topic_name=topic_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -92788,9 +97623,9 @@ async def get_kafka_topic( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_kafka_topic( @@ -92802,6 +97637,7 @@ async def update_kafka_topic( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Topic for a Kafka Cluster. To update a topic attached to a Kafka cluster, send a PUT request to @@ -93061,11 +97897,12 @@ async def update_kafka_topic( self, database_cluster_uuid: str, topic_name: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Topic for a Kafka Cluster. To update a topic attached to a Kafka cluster, send a PUT request to @@ -93078,7 +97915,7 @@ async def update_kafka_topic( :param topic_name: The name used to identify the Kafka topic. Required. :type topic_name: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -93231,9 +98068,10 @@ async def update_kafka_topic( self, database_cluster_uuid: str, topic_name: str, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Topic for a Kafka Cluster. To update a topic attached to a Kafka cluster, send a PUT request to @@ -93245,11 +98083,8 @@ async def update_kafka_topic( :type database_cluster_uuid: str :param topic_name: The name used to identify the Kafka topic. Required. :type topic_name: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -93257,6 +98092,100 @@ async def update_kafka_topic( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "config": { + "cleanup_policy": "delete", # Optional. Default value is "delete". + The cleanup_policy sets the retention policy to use on log segments. 'delete' + will discard old segments when retention time/size limits are reached. + 'compact' will enable log compaction, resulting in retention of the latest + value for each key. Known values are: "delete", "compact", and + "compact_delete". + "compression_type": "producer", # Optional. Default value is + "producer". The compression_type specifies the compression type of the topic. + Known values are: "producer", "gzip", "snappy", "Iz4", "zstd", and + "uncompressed". + "delete_retention_ms": 86400000, # Optional. Default value is + 86400000. The delete_retention_ms specifies how long (in ms) to retain delete + tombstone markers for topics. + "file_delete_delay_ms": 60000, # Optional. Default value is 60000. + The file_delete_delay_ms specifies the time (in ms) to wait before deleting a + file from the filesystem. + "flush_messages": 9223372036854776000, # Optional. Default value is + 9223372036854776000. The flush_messages specifies the number of messages to + accumulate on a log partition before messages are flushed to disk. + "flush_ms": 9223372036854776000, # Optional. Default value is + 9223372036854776000. The flush_ms specifies the maximum time (in ms) that a + message is kept in memory before being flushed to disk. + "index_interval_bytes": 4096, # Optional. Default value is 4096. The + index_interval_bytes specifies the number of bytes between entries being + added into te offset index. + "max_compaction_lag_ms": 9223372036854776000, # Optional. Default + value is 9223372036854776000. The max_compaction_lag_ms specifies the maximum + amount of time (in ms) that a message will remain uncompacted. This is only + applicable if the logs are have compaction enabled. + "max_message_bytes": 1048588, # Optional. Default value is 1048588. + The max_messages_bytes specifies the largest record batch size (in bytes) + that can be sent to the server. This is calculated after compression if + compression is enabled. + "message_down_conversion_enable": True, # Optional. Default value is + True. The message_down_conversion_enable specifies whether down-conversion of + message formats is enabled to satisfy consumer requests. When 'false', the + broker will not perform conversion for consumers expecting older message + formats. The broker will respond with an ``UNSUPPORTED_VERSION`` error for + consume requests from these older clients. + "message_format_version": "3.0-IV1", # Optional. Default value is + "3.0-IV1". The message_format_version specifies the message format version + used by the broker to append messages to the logs. The value of this setting + is assumed to be 3.0-IV1 if the broker protocol version is 3.0 or higher. By + setting a particular message format version, all existing messages on disk + must be smaller or equal to the specified version. Known values are: "0.8.0", + "0.8.1", "0.8.2", "0.9.0", "0.10.0-IV0", "0.10.0-IV1", "0.10.1-IV0", + "0.10.1-IV1", "0.10.1-IV2", "0.10.2-IV0", "0.11.0-IV0", "0.11.0-IV1", + "0.11.0-IV2", "1.0-IV0", "1.1-IV0", "2.0-IV0", "2.0-IV1", "2.1-IV0", + "2.1-IV1", "2.1-IV2", "2.2-IV0", "2.2-IV1", "2.3-IV0", "2.3-IV1", "2.4-IV0", + "2.4-IV1", "2.5-IV0", "2.6-IV0", "2.7-IV0", "2.7-IV1", "2.7-IV2", "2.8-IV0", + "2.8-IV1", "3.0-IV0", "3.0-IV1", "3.1-IV0", "3.2-IV0", "3.3-IV0", "3.3-IV1", + "3.3-IV2", and "3.3-IV3". + "message_timestamp_type": "create_time", # Optional. Default value + is "create_time". The message_timestamp_type specifies whether to use the + message create time or log append time as the timestamp on a message. Known + values are: "create_time" and "log_append_time". + "min_cleanable_dirty_ratio": 0.5, # Optional. Default value is 0.5. + The min_cleanable_dirty_ratio specifies the frequency of log compaction (if + enabled) in relation to duplicates present in the logs. For example, at 0.5, + at most 50% of the log could be duplicates before compaction would begin. + "min_compaction_lag_ms": 0, # Optional. Default value is 0. The + min_compaction_lag_ms specifies the minimum time (in ms) that a message will + remain uncompacted in the log. Only relevant if log compaction is enabled. + "min_insync_replicas": 1, # Optional. Default value is 1. The + min_insync_replicas specifies the number of replicas that must ACK a write + for the write to be considered successful. + "preallocate": False, # Optional. Default value is False. The + preallocate specifies whether a file should be preallocated on disk when + creating a new log segment. + "retention_bytes": -1, # Optional. Default value is -1. The + retention_bytes specifies the maximum size of the log (in bytes) before + deleting messages. -1 indicates that there is no limit. + "retention_ms": 604800000, # Optional. Default value is 604800000. + The retention_ms specifies the maximum amount of time (in ms) to keep a + message before deleting it. + "segment_bytes": 209715200, # Optional. Default value is 209715200. + The segment_bytes specifies the maximum size of a single log file (in bytes). + "segment_jitter_ms": 0, # Optional. Default value is 0. The + segment_jitter_ms specifies the maximum random jitter subtracted from the + scheduled segment roll time to avoid thundering herds of segment rolling. + "segment_ms": 604800000 # Optional. Default value is 604800000. The + segment_ms specifies the period of time after which the log will be forced to + roll if the segment file isn't full. This ensures that retention can delete + or compact old data. + }, + "partition_count": 0, # Optional. The number of partitions available for the + topic. On update, this value can only be increased. + "replication_factor": 0 # Optional. The number of nodes to replicate data + across the cluster. + } + # response body for status code(s): 200 response == { "topic": { @@ -93393,10 +98322,14 @@ async def update_kafka_topic( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93405,15 +98338,15 @@ async def update_kafka_topic( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -93421,7 +98354,7 @@ async def update_kafka_topic( else: _json = None - request = build_databases_update_kafka_topic_request( + _request = build_databases_update_kafka_topic_request( database_cluster_uuid=database_cluster_uuid, topic_name=topic_name, content_type=content_type, @@ -93430,18 +98363,21 @@ async def update_kafka_topic( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -93478,14 +98414,15 @@ async def update_kafka_topic( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_kafka_topic( self, database_cluster_uuid: str, topic_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Topic for a Kafka Cluster. To delete a single topic within a Kafka cluster, send a DELETE request @@ -93517,10 +98454,14 @@ async def delete_kafka_topic( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93529,26 +98470,29 @@ async def delete_kafka_topic( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_kafka_topic_request( + _request = build_databases_delete_kafka_topic_request( database_cluster_uuid=database_cluster_uuid, topic_name=topic_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -93581,12 +98525,13 @@ async def delete_kafka_topic( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_cluster_metrics_credentials(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve Database Clusters' Metrics Endpoint Credentials. To show the credentials for all database clusters' metrics endpoints, send a GET request to @@ -93623,10 +98568,14 @@ async def get_cluster_metrics_credentials(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93635,24 +98584,27 @@ async def get_cluster_metrics_credentials(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_cluster_metrics_credentials_request( + _request = build_databases_get_cluster_metrics_credentials_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -93689,9 +98641,9 @@ async def get_cluster_metrics_credentials(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-statements @@ -93733,7 +98685,7 @@ async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-re @overload async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-statements self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -93745,7 +98697,7 @@ async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-re status code with no body in response. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -93756,7 +98708,7 @@ async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-re @distributed_trace_async async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """Update Database Clusters' Metrics Endpoint Credentials. @@ -93764,19 +98716,33 @@ async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-re ``/v2/databases/metrics/credentials``. A successful request will receive a 204 No Content status code with no body in response. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "credentials": { + "basic_auth_password": "str", # Optional. basic authentication + password for metrics HTTP endpoint. + "basic_auth_username": "str" # Optional. basic authentication + username for metrics HTTP endpoint. + } + } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93785,15 +98751,15 @@ async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-re _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -93801,25 +98767,28 @@ async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-re else: _json = None - request = build_databases_update_cluster_metrics_credentials_request( + _request = build_databases_update_cluster_metrics_credentials_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -93834,7 +98803,7 @@ async def update_cluster_metrics_credentials( # pylint: disable=inconsistent-re ) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) # type: ignore class DomainsOperations: @@ -93858,6 +98827,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Domains. To retrieve a list of all of the domains in your account, send a GET request to @@ -93896,18 +98866,22 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO accessible as an individual record resource. } ], - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. + }, + "links": { + "pages": {} } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93916,26 +98890,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_domains_list_request( + _request = build_domains_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -93955,9 +98932,9 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( @@ -93967,6 +98944,7 @@ async def create( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain. To create a new domain, send a POST request to ``/v2/domains``. Set the "name" @@ -94029,11 +99007,12 @@ async def create( @overload async def create( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain. To create a new domain, send a POST request to ``/v2/domains``. Set the "name" @@ -94042,7 +99021,7 @@ async def create( to the apex domain. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -94077,8 +99056,9 @@ async def create( @distributed_trace_async async def create( - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain. To create a new domain, send a POST request to ``/v2/domains``. Set the "name" @@ -94086,11 +99066,8 @@ async def create( "ip_address" attribute, and an A record will be automatically created pointing to the apex domain. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -94098,6 +99075,24 @@ async def create( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "ip_address": "str", # Optional. This optional attribute may contain an IP + address. When provided, an A record will be automatically created pointing to the + apex domain. + "name": "str", # Optional. The name of the domain itself. This should follow + the standard domain format of domain.TLD. For instance, ``example.com`` is a + valid domain name. + "ttl": 0, # Optional. This value is the time to live for the records on this + domain, in seconds. This defines the time frame that clients can cache queried + information before a refresh should be requested. + "zone_file": "str" # Optional. This attribute contains the complete contents + of the zone file for the selected domain. Individual domain record resources + should be used to get more granular control over records. However, this attribute + can also be used to get information about the SOA record, which is created + automatically and is not accessible as an individual record resource. + } + # response body for status code(s): 201 response == { "domain": { @@ -94119,10 +99114,14 @@ async def create( } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94131,15 +99130,15 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -94147,25 +99146,28 @@ async def create( else: _json = None - request = build_domains_create_request( + _request = build_domains_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94185,12 +99187,13 @@ async def create( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, domain_name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Domain. To get details about a specific domain, send a GET request to ``/v2/domains/$DOMAIN_NAME``. @@ -94236,10 +99239,14 @@ async def get(self, domain_name: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94248,25 +99255,28 @@ async def get(self, domain_name: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_domains_get_request( + _request = build_domains_get_request( domain_name=domain_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94303,12 +99313,13 @@ async def get(self, domain_name: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, domain_name: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Domain. To delete a domain, send a DELETE request to ``/v2/domains/$DOMAIN_NAME``. @@ -94334,10 +99345,14 @@ async def delete(self, domain_name: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94346,25 +99361,28 @@ async def delete(self, domain_name: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_domains_delete_request( + _request = build_domains_delete_request( domain_name=domain_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -94397,9 +99415,9 @@ async def delete(self, domain_name: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_records( @@ -94412,6 +99430,7 @@ async def list_records( page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Domain Records. To get a listing of all records configured for a domain, send a GET request to @@ -94419,7 +99438,7 @@ async def list_records( The list of records returned can be filtered by using the ``name`` and ``type`` query parameters. For example, to only include A records for a domain, send a GET request to ``/v2/domains/$DOMAIN_NAME/records?type=A``. ``name`` must be a fully qualified record name. - For example, to only include records matching ``sub.example.com``\ , send a GET request to + For example, to only include records matching ``sub.example.com``\\ , send a GET request to ``/v2/domains/$DOMAIN_NAME/records?name=sub.example.com``. Both name and type may be used together. @@ -94445,8 +99464,13 @@ async def list_records( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "domain_records": [ { + "type": "str", # The type of the DNS record. For example: A, + CNAME, TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would @@ -94466,16 +99490,11 @@ async def list_records( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, - CNAME, TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -94490,10 +99509,14 @@ async def list_records( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94502,9 +99525,9 @@ async def list_records( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_domains_list_records_request( + _request = build_domains_list_records_request( domain_name=domain_name, name=name, type=type, @@ -94513,18 +99536,21 @@ async def list_records( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94561,9 +99587,9 @@ async def list_records( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_record( @@ -94574,6 +99600,7 @@ async def create_record( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain Record. To create a new record to a domain, send a POST request to @@ -94605,6 +99632,8 @@ async def create_record( # response body for status code(s): 201 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -94621,8 +99650,6 @@ async def create_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -94643,11 +99670,12 @@ async def create_record( async def create_record( self, domain_name: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain Record. To create a new record to a domain, send a POST request to @@ -94662,7 +99690,7 @@ async def create_record( :param domain_name: The name of the domain itself. Required. :type domain_name: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -94676,6 +99704,8 @@ async def create_record( # response body for status code(s): 201 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -94692,8 +99722,6 @@ async def create_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -94712,8 +99740,12 @@ async def create_record( @distributed_trace_async async def create_record( - self, domain_name: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + domain_name: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain Record. To create a new record to a domain, send a POST request to @@ -94727,11 +99759,8 @@ async def create_record( :param domain_name: The name of the domain itself. Required. :type domain_name: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -94739,9 +99768,14 @@ async def create_record( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -94758,8 +99792,6 @@ async def create_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -94775,10 +99807,14 @@ async def create_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94787,15 +99823,15 @@ async def create_record( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -94803,7 +99839,7 @@ async def create_record( else: _json = None - request = build_domains_create_record_request( + _request = build_domains_create_record_request( domain_name=domain_name, content_type=content_type, json=_json, @@ -94811,18 +99847,21 @@ async def create_record( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94859,14 +99898,15 @@ async def create_record( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_record( self, domain_name: str, domain_record_id: int, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Domain Record. To retrieve a specific domain record, send a GET request to @@ -94886,6 +99926,8 @@ async def get_record( # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -94902,8 +99944,6 @@ async def get_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -94919,10 +99959,14 @@ async def get_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94931,26 +99975,29 @@ async def get_record( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_domains_get_record_request( + _request = build_domains_get_record_request( domain_name=domain_name, domain_record_id=domain_record_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94987,9 +100034,9 @@ async def get_record( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def patch_record( @@ -95001,6 +100048,7 @@ async def patch_record( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PATCH request to @@ -95028,6 +100076,8 @@ async def patch_record( # JSON input template you can fill out and use as your body input. body = { + "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... + Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the @@ -95044,14 +100094,14 @@ async def patch_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... - Required. "weight": 0 # Optional. The weight for SRV records. } # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -95068,8 +100118,6 @@ async def patch_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -95091,11 +100139,12 @@ async def patch_record( self, domain_name: str, domain_record_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PATCH request to @@ -95110,7 +100159,7 @@ async def patch_record( :param domain_record_id: The unique identifier of the domain record. Required. :type domain_record_id: int :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -95124,6 +100173,8 @@ async def patch_record( # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -95140,8 +100191,6 @@ async def patch_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -95163,9 +100212,10 @@ async def patch_record( self, domain_name: str, domain_record_id: int, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PATCH request to @@ -95179,11 +100229,8 @@ async def patch_record( :type domain_name: str :param domain_record_id: The unique identifier of the domain record. Required. :type domain_record_id: int - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -95191,9 +100238,34 @@ async def patch_record( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... + Required. + "data": "str", # Optional. Variable data depending on record type. For + example, the "data" value for an A record would be the IPv4 address to which the + domain will be mapped. For a CAA record, it would contain the domain name of the + CA being granted permission to issue certificates. + "flags": 0, # Optional. An unsigned integer between 0-255 used for CAA + records. + "id": 0, # Optional. A unique identifier for each domain record. + "name": "str", # Optional. The host name, alias, or service being defined by + the record. + "port": 0, # Optional. The port for SRV records. + "priority": 0, # Optional. The priority for SRV and MX records. + "tag": "str", # Optional. The parameter tag for CAA records. Valid values + are "issue", "issuewild", or "iodef". + "ttl": 0, # Optional. This value is the time to live for the record, in + seconds. This defines the time frame that clients can cache queried information + before a refresh should be requested. + "weight": 0 # Optional. The weight for SRV records. + } + # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -95210,8 +100282,6 @@ async def patch_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -95227,10 +100297,14 @@ async def patch_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -95239,15 +100313,15 @@ async def patch_record( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -95255,7 +100329,7 @@ async def patch_record( else: _json = None - request = build_domains_patch_record_request( + _request = build_domains_patch_record_request( domain_name=domain_name, domain_record_id=domain_record_id, content_type=content_type, @@ -95264,18 +100338,21 @@ async def patch_record( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -95312,9 +100389,9 @@ async def patch_record( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_record( @@ -95326,6 +100403,7 @@ async def update_record( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PUT request to @@ -95353,6 +100431,8 @@ async def update_record( # JSON input template you can fill out and use as your body input. body = { + "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... + Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the @@ -95369,14 +100449,14 @@ async def update_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... - Required. "weight": 0 # Optional. The weight for SRV records. } # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -95393,8 +100473,6 @@ async def update_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -95416,11 +100494,12 @@ async def update_record( self, domain_name: str, domain_record_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PUT request to @@ -95435,7 +100514,7 @@ async def update_record( :param domain_record_id: The unique identifier of the domain record. Required. :type domain_record_id: int :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -95449,6 +100528,8 @@ async def update_record( # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -95465,8 +100546,6 @@ async def update_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -95488,9 +100567,10 @@ async def update_record( self, domain_name: str, domain_record_id: int, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PUT request to @@ -95504,11 +100584,8 @@ async def update_record( :type domain_name: str :param domain_record_id: The unique identifier of the domain record. Required. :type domain_record_id: int - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -95516,9 +100593,34 @@ async def update_record( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... + Required. + "data": "str", # Optional. Variable data depending on record type. For + example, the "data" value for an A record would be the IPv4 address to which the + domain will be mapped. For a CAA record, it would contain the domain name of the + CA being granted permission to issue certificates. + "flags": 0, # Optional. An unsigned integer between 0-255 used for CAA + records. + "id": 0, # Optional. A unique identifier for each domain record. + "name": "str", # Optional. The host name, alias, or service being defined by + the record. + "port": 0, # Optional. The port for SRV records. + "priority": 0, # Optional. The priority for SRV and MX records. + "tag": "str", # Optional. The parameter tag for CAA records. Valid values + are "issue", "issuewild", or "iodef". + "ttl": 0, # Optional. This value is the time to live for the record, in + seconds. This defines the time frame that clients can cache queried information + before a refresh should be requested. + "weight": 0 # Optional. The weight for SRV records. + } + # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -95535,8 +100637,6 @@ async def update_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -95552,10 +100652,14 @@ async def update_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -95564,15 +100668,15 @@ async def update_record( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -95580,7 +100684,7 @@ async def update_record( else: _json = None - request = build_domains_update_record_request( + _request = build_domains_update_record_request( domain_name=domain_name, domain_record_id=domain_record_id, content_type=content_type, @@ -95589,18 +100693,21 @@ async def update_record( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -95637,14 +100744,15 @@ async def update_record( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_record( self, domain_name: str, domain_record_id: int, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Domain Record. To delete a record for a domain, send a DELETE request to @@ -95676,10 +100784,14 @@ async def delete_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -95688,26 +100800,29 @@ async def delete_record( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_domains_delete_record_request( + _request = build_domains_delete_record_request( domain_name=domain_name, domain_record_id=domain_record_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -95740,9 +100855,9 @@ async def delete_record( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class DropletsOperations: @@ -95774,6 +100889,7 @@ async def list( name: Optional[str] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Droplets. To list all Droplets in your account, send a GET request to ``/v2/droplets``. @@ -95809,6 +100925,9 @@ async def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "droplets": [ { "backup_ids": [ @@ -95844,7 +100963,7 @@ async def list( "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string - containing information about errors that may occur when importing"n a + containing information about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. @@ -95869,7 +100988,7 @@ async def list( public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string - indicating the state of a custom image. This may be ``NEW``"" ,"n + indicating the state of a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". @@ -95887,16 +101006,6 @@ async def list( (e.g. DOKS worker nodes). Known values are: "base", "snapshot", "backup", "custom", and "admin". }, - "kernel": { - "id": 0, # Optional. A unique number used to - identify and reference a specific kernel. - "name": "str", # Optional. The display name of the - kernel. This is shown in the web UI and is generally a descriptive - title for the kernel in question. - "version": "str" # Optional. A standard kernel - version string representing the version, patch, and release - information. - }, "locked": bool, # A boolean value indicating whether the Droplet has been locked, preventing actions by users. Required. "memory": 0, # Memory of the Droplet in megabytes. Required. @@ -95906,9 +101015,9 @@ async def list( "v4": [ { "gateway": "str", # Optional. The - gateway of the specified IPv4 network interface."n"nFor - private interfaces, a gateway is not provided. This is - denoted by"nreturning ``nil`` as its value. + gateway of the specified IPv4 network interface. For private + interfaces, a gateway is not provided. This is denoted by + returning ``nil`` as its value. "ip_address": "str", # Optional. The IP address of the IPv4 network interface. "netmask": "str", # Optional. The @@ -95927,7 +101036,7 @@ async def list( "netmask": 0, # Optional. The netmask of the IPv6 network interface. "type": "str" # Optional. The type - of the IPv6 network interface."n"n**Note**"" : IPv6 private + of the IPv6 network interface. **Note**"" : IPv6 private networking is not currently supported. "public" } ] @@ -96006,22 +101115,33 @@ class of Droplets created from this size. For example: Basic, General "str" # A flat array including the unique identifier for each Block Storage volume attached to the Droplet. Required. ], + "kernel": { + "id": 0, # Optional. A unique number used to + identify and reference a specific kernel. + "name": "str", # Optional. The display name of the + kernel. This is shown in the web UI and is generally a descriptive + title for the kernel in question. + "version": "str" # Optional. A standard kernel + version string representing the version, patch, and release + information. + }, "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Droplet is assigned. } ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96030,9 +101150,9 @@ class of Droplets created from this size. For example: Basic, General _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_request( + _request = build_droplets_list_request( per_page=per_page, page=page, tag_name=tag_name, @@ -96040,18 +101160,21 @@ class of Droplets created from this size. For example: Basic, General headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96071,9 +101194,9 @@ class of Droplets created from this size. For example: Basic, General deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( @@ -96131,7 +101254,7 @@ async def create( @overload async def create( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -96166,7 +101289,7 @@ async def create( check the status of each individual Droplet create event. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -96177,7 +101300,7 @@ async def create( @distributed_trace_async async def create( - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: """Create a New Droplet. @@ -96208,19 +101331,26 @@ async def create( of ``actions`` returned as part of the response's ``links`` object can be used to check the status of each individual Droplet create event. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = {} """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96229,15 +101359,15 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -96245,25 +101375,28 @@ async def create( else: _json = None - request = build_droplets_create_request( + _request = build_droplets_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96283,12 +101416,13 @@ async def create( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def destroy_by_tag(self, *, tag_name: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Deleting Droplets by Tag. To delete **all** Droplets assigned to a specific tag, include the ``tag_name`` @@ -96319,10 +101453,14 @@ async def destroy_by_tag(self, *, tag_name: str, **kwargs: Any) -> Optional[JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96331,25 +101469,28 @@ async def destroy_by_tag(self, *, tag_name: str, **kwargs: Any) -> Optional[JSON _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_droplets_destroy_by_tag_request( + _request = build_droplets_destroy_by_tag_request( tag_name=tag_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -96385,12 +101526,13 @@ async def destroy_by_tag(self, *, tag_name: str, **kwargs: Any) -> Optional[JSON deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get(self, droplet_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Droplet. To show information about an individual Droplet, send a GET request to @@ -96439,7 +101581,7 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing - information about errors that may occur when importing"n a custom image. + information about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB @@ -96463,7 +101605,7 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the - state of a custom image. This may be ``NEW``"" ,"n ``available``"" , + state of a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -96480,15 +101622,6 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: worker nodes). Known values are: "base", "snapshot", "backup", "custom", and "admin". }, - "kernel": { - "id": 0, # Optional. A unique number used to identify and - reference a specific kernel. - "name": "str", # Optional. The display name of the kernel. - This is shown in the web UI and is generally a descriptive title for the - kernel in question. - "version": "str" # Optional. A standard kernel version - string representing the version, patch, and release information. - }, "locked": bool, # A boolean value indicating whether the Droplet has been locked, preventing actions by users. Required. "memory": 0, # Memory of the Droplet in megabytes. Required. @@ -96498,9 +101631,9 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: "v4": [ { "gateway": "str", # Optional. The gateway of - the specified IPv4 network interface."n"nFor private interfaces, - a gateway is not provided. This is denoted by"nreturning ``nil`` - as its value. + the specified IPv4 network interface. For private interfaces, a + gateway is not provided. This is denoted by returning ``nil`` as + its value. "ip_address": "str", # Optional. The IP address of the IPv4 network interface. "netmask": "str", # Optional. The netmask of @@ -96518,8 +101651,8 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: "netmask": 0, # Optional. The netmask of the IPv6 network interface. "type": "str" # Optional. The type of the - IPv6 network interface."n"n**Note**"" : IPv6 private networking - is not currently supported. "public" + IPv6 network interface. **Note**"" : IPv6 private networking is + not currently supported. "public" } ] }, @@ -96592,6 +101725,15 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: "str" # A flat array including the unique identifier for each Block Storage volume attached to the Droplet. Required. ], + "kernel": { + "id": 0, # Optional. A unique number used to identify and + reference a specific kernel. + "name": "str", # Optional. The display name of the kernel. + This is shown in the web UI and is generally a descriptive title for the + kernel in question. + "version": "str" # Optional. A standard kernel version + string representing the version, patch, and release information. + }, "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Droplet is assigned. } @@ -96608,10 +101750,14 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96620,25 +101766,28 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_get_request( + _request = build_droplets_get_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96675,12 +101824,13 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def destroy(self, droplet_id: int, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Existing Droplet. To delete a Droplet, send a DELETE request to ``/v2/droplets/$DROPLET_ID``. @@ -96709,10 +101859,14 @@ async def destroy(self, droplet_id: int, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96721,25 +101875,28 @@ async def destroy(self, droplet_id: int, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_droplets_destroy_request( + _request = build_droplets_destroy_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -96775,14 +101932,15 @@ async def destroy(self, droplet_id: int, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_backups( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Backups for a Droplet. To retrieve any backups associated with a Droplet, send a GET request to @@ -96807,6 +101965,9 @@ async def list_backups( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "backups": [ { "created_at": "2020-02-20 00:00:00", # A time value given in @@ -96831,9 +101992,6 @@ async def list_backups( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -96848,10 +102006,14 @@ async def list_backups( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96860,27 +102022,30 @@ async def list_backups( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_backups_request( + _request = build_droplets_list_backups_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96917,14 +102082,15 @@ async def list_backups( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_snapshots( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Snapshots for a Droplet. To retrieve the snapshots that have been created from a Droplet, send a GET @@ -96949,12 +102115,12 @@ async def list_snapshots( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "snapshots": [ { "created_at": "2020-02-20 00:00:00", # A time value given in @@ -96990,10 +102156,14 @@ async def list_snapshots( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97002,27 +102172,30 @@ async def list_snapshots( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_snapshots_request( + _request = build_droplets_list_snapshots_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -97059,14 +102232,15 @@ async def list_snapshots( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_kernels( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Available Kernels for a Droplet. To retrieve a list of all kernels available to a Droplet, send a GET request @@ -97091,6 +102265,9 @@ async def list_kernels( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "kernels": [ { "id": 0, # Optional. A unique number used to identify and @@ -97104,9 +102281,6 @@ async def list_kernels( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -97121,10 +102295,14 @@ async def list_kernels( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97133,27 +102311,30 @@ async def list_kernels( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_kernels_request( + _request = build_droplets_list_kernels_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -97190,14 +102371,15 @@ async def list_kernels( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_firewalls( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List all Firewalls Applied to a Droplet. To retrieve a list of all firewalls available to a Droplet, send a GET request @@ -97222,6 +102404,9 @@ async def list_firewalls( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "firewalls": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -97336,9 +102521,6 @@ async def list_firewalls( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -97353,10 +102535,14 @@ async def list_firewalls( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97365,27 +102551,30 @@ async def list_firewalls( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_firewalls_request( + _request = build_droplets_list_firewalls_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -97422,12 +102611,13 @@ async def list_firewalls( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Neighbors for a Droplet. To retrieve a list of any "neighbors" (i.e. Droplets that are co-located on @@ -97485,7 +102675,7 @@ async def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string - containing information about errors that may occur when importing"n a + containing information about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. @@ -97510,7 +102700,7 @@ async def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string - indicating the state of a custom image. This may be ``NEW``"" ,"n + indicating the state of a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". @@ -97528,16 +102718,6 @@ async def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: (e.g. DOKS worker nodes). Known values are: "base", "snapshot", "backup", "custom", and "admin". }, - "kernel": { - "id": 0, # Optional. A unique number used to - identify and reference a specific kernel. - "name": "str", # Optional. The display name of the - kernel. This is shown in the web UI and is generally a descriptive - title for the kernel in question. - "version": "str" # Optional. A standard kernel - version string representing the version, patch, and release - information. - }, "locked": bool, # A boolean value indicating whether the Droplet has been locked, preventing actions by users. Required. "memory": 0, # Memory of the Droplet in megabytes. Required. @@ -97547,9 +102727,9 @@ async def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: "v4": [ { "gateway": "str", # Optional. The - gateway of the specified IPv4 network interface."n"nFor - private interfaces, a gateway is not provided. This is - denoted by"nreturning ``nil`` as its value. + gateway of the specified IPv4 network interface. For private + interfaces, a gateway is not provided. This is denoted by + returning ``nil`` as its value. "ip_address": "str", # Optional. The IP address of the IPv4 network interface. "netmask": "str", # Optional. The @@ -97568,7 +102748,7 @@ async def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: "netmask": 0, # Optional. The netmask of the IPv6 network interface. "type": "str" # Optional. The type - of the IPv6 network interface."n"n**Note**"" : IPv6 private + of the IPv6 network interface. **Note**"" : IPv6 private networking is not currently supported. "public" } ] @@ -97647,6 +102827,16 @@ class of Droplets created from this size. For example: Basic, General "str" # A flat array including the unique identifier for each Block Storage volume attached to the Droplet. Required. ], + "kernel": { + "id": 0, # Optional. A unique number used to + identify and reference a specific kernel. + "name": "str", # Optional. The display name of the + kernel. This is shown in the web UI and is generally a descriptive + title for the kernel in question. + "version": "str" # Optional. A standard kernel + version string representing the version, patch, and release + information. + }, "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Droplet is assigned. } @@ -97664,10 +102854,14 @@ class of Droplets created from this size. For example: Basic, General tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97676,25 +102870,28 @@ class of Droplets created from this size. For example: Basic, General _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_neighbors_request( + _request = build_droplets_list_neighbors_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -97731,19 +102928,20 @@ class of Droplets created from this size. For example: Basic, General deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_associated_resources(self, droplet_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Associated Resources for a Droplet. To list the associated billable resources that can be destroyed along with a Droplet, send a GET request to the ``/v2/droplets/$DROPLET_ID/destroy_with_associated_resources`` endpoint. - The response will be a JSON object containing ``snapshots``\ , ``volumes``\ , and + The response will be a JSON object containing ``snapshots``\\ , ``volumes``\\ , and ``volume_snapshots`` keys. Each will be set to an array of objects containing information about the associated resources. @@ -97821,10 +103019,14 @@ async def list_associated_resources(self, droplet_id: int, **kwargs: Any) -> JSO tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97833,25 +103035,28 @@ async def list_associated_resources(self, droplet_id: int, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_associated_resources_request( + _request = build_droplets_list_associated_resources_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -97888,12 +103093,12 @@ async def list_associated_resources(self, droplet_id: int, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload - async def destroy_with_associated_resources_selective( + async def destroy_with_associated_resources_selective( # pylint: disable=name-too-long self, droplet_id: int, body: Optional[JSON] = None, @@ -97901,12 +103106,13 @@ async def destroy_with_associated_resources_selective( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Destroy a Droplet and its Associated Resources. To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the ``/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`` - endpoint. The JSON body of the request should include ``reserved_ips``\ , ``snapshots``\ , - ``volumes``\ , + endpoint. The JSON body of the request should include ``reserved_ips``\\ , ``snapshots``\\ , + ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request @@ -97968,20 +103174,21 @@ async def destroy_with_associated_resources_selective( """ @overload - async def destroy_with_associated_resources_selective( + async def destroy_with_associated_resources_selective( # pylint: disable=name-too-long self, droplet_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Destroy a Droplet and its Associated Resources. To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the ``/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`` - endpoint. The JSON body of the request should include ``reserved_ips``\ , ``snapshots``\ , - ``volumes``\ , + endpoint. The JSON body of the request should include ``reserved_ips``\\ , ``snapshots``\\ , + ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request @@ -97994,7 +103201,7 @@ async def destroy_with_associated_resources_selective( :param droplet_id: A unique identifier for a Droplet instance. Required. :type droplet_id: int :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -98019,15 +103226,19 @@ async def destroy_with_associated_resources_selective( """ @distributed_trace_async - async def destroy_with_associated_resources_selective( - self, droplet_id: int, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + async def destroy_with_associated_resources_selective( # pylint: disable=name-too-long + self, + droplet_id: int, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Destroy a Droplet and its Associated Resources. To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the ``/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`` - endpoint. The JSON body of the request should include ``reserved_ips``\ , ``snapshots``\ , - ``volumes``\ , + endpoint. The JSON body of the request should include ``reserved_ips``\\ , ``snapshots``\\ , + ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request @@ -98039,11 +103250,8 @@ async def destroy_with_associated_resources_selective( :param droplet_id: A unique identifier for a Droplet instance. Required. :type droplet_id: int - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -98051,6 +103259,30 @@ async def destroy_with_associated_resources_selective( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "floating_ips": [ + "str" # Optional. An array of unique identifiers for the floating + IPs to be scheduled for deletion. + ], + "reserved_ips": [ + "str" # Optional. An array of unique identifiers for the reserved + IPs to be scheduled for deletion. + ], + "snapshots": [ + "str" # Optional. An array of unique identifiers for the snapshots + to be scheduled for deletion. + ], + "volume_snapshots": [ + "str" # Optional. An array of unique identifiers for the volume + snapshots to be scheduled for deletion. + ], + "volumes": [ + "str" # Optional. An array of unique identifiers for the volumes to + be scheduled for deletion. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -98063,10 +103295,14 @@ async def destroy_with_associated_resources_selective( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98075,15 +103311,15 @@ async def destroy_with_associated_resources_selective( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -98091,7 +103327,7 @@ async def destroy_with_associated_resources_selective( else: _json = None - request = build_droplets_destroy_with_associated_resources_selective_request( + _request = build_droplets_destroy_with_associated_resources_selective_request( droplet_id=droplet_id, content_type=content_type, json=_json, @@ -98099,18 +103335,21 @@ async def destroy_with_associated_resources_selective( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -98143,14 +103382,15 @@ async def destroy_with_associated_resources_selective( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async - async def destroy_with_associated_resources_dangerous( + async def destroy_with_associated_resources_dangerous( # pylint: disable=name-too-long self, droplet_id: int, *, x_dangerous: bool, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Destroy a Droplet and All of its Associated Resources (Dangerous). To destroy a Droplet along with all of its associated resources, send a DELETE @@ -98188,10 +103428,14 @@ async def destroy_with_associated_resources_dangerous( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98200,26 +103444,29 @@ async def destroy_with_associated_resources_dangerous( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_droplets_destroy_with_associated_resources_dangerous_request( + _request = build_droplets_destroy_with_associated_resources_dangerous_request( droplet_id=droplet_id, x_dangerous=x_dangerous, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -98252,14 +103499,15 @@ async def destroy_with_associated_resources_dangerous( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_destroy_associated_resources_status( self, droplet_id: int, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Check Status of a Droplet Destroy with Associated Resources Request. To check on the status of a request to destroy a Droplet with its associated @@ -98378,10 +103626,14 @@ async def get_destroy_associated_resources_status( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98390,25 +103642,28 @@ async def get_destroy_associated_resources_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_get_destroy_associated_resources_status_request( + _request = build_droplets_get_destroy_associated_resources_status_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -98445,14 +103700,15 @@ async def get_destroy_associated_resources_status( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def destroy_retry_with_associated_resources( self, droplet_id: int, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Retry a Droplet Destroy with Associated Resources Request. If the status of a request to destroy a Droplet with its associated resources @@ -98485,10 +103741,14 @@ async def destroy_retry_with_associated_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98497,25 +103757,28 @@ async def destroy_retry_with_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_droplets_destroy_retry_with_associated_resources_request( + _request = build_droplets_destroy_retry_with_associated_resources_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404, 409]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -98564,12 +103827,13 @@ async def destroy_retry_with_associated_resources( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_neighbors_ids(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Droplet Neighbors. To retrieve a list of all Droplets that are co-located on the same physical @@ -98609,10 +103873,14 @@ async def list_neighbors_ids(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98621,24 +103889,27 @@ async def list_neighbors_ids(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_neighbors_ids_request( + _request = build_droplets_list_neighbors_ids_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -98675,9 +103946,9 @@ async def list_neighbors_ids(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class DropletActionsOperations: @@ -98703,6 +103974,7 @@ def __init__(self, *args, **kwargs) -> None: async def list( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Actions for a Droplet. To retrieve a list of all actions that have been executed for a Droplet, send @@ -98727,6 +103999,9 @@ async def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -98768,9 +104043,6 @@ async def list( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -98785,10 +104057,14 @@ async def list( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98797,27 +104073,30 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplet_actions_list_request( + _request = build_droplet_actions_list_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -98854,9 +104133,9 @@ async def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def post( @@ -98867,6 +104146,7 @@ async def post( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate a Droplet Action. To initiate an action on a Droplet send a POST request to @@ -98999,11 +104279,12 @@ async def post( async def post( self, droplet_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate a Droplet Action. To initiate an action on a Droplet send a POST request to @@ -99067,7 +104348,7 @@ async def post( :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional attributes to be set as well. Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -99131,8 +104412,12 @@ async def post( @distributed_trace_async async def post( - self, droplet_id: int, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + droplet_id: int, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate a Droplet Action. To initiate an action on a Droplet send a POST request to @@ -99195,11 +104480,9 @@ async def post( :type droplet_id: int :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional - attributes to be set as well. Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + attributes to be set as well. Is either a JSON type or a IO[bytes] type. Default value is + None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -99207,6 +104490,9 @@ async def post( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "action": { @@ -99257,10 +104543,14 @@ async def post( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -99269,15 +104559,15 @@ async def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -99285,7 +104575,7 @@ async def post( else: _json = None - request = build_droplet_actions_post_request( + _request = build_droplet_actions_post_request( droplet_id=droplet_id, content_type=content_type, json=_json, @@ -99293,18 +104583,21 @@ async def post( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -99341,9 +104634,9 @@ async def post( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def post_by_tag( @@ -99354,6 +104647,7 @@ async def post_by_tag( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Acting on Tagged Droplets. Some actions can be performed in bulk on tagged Droplets. The actions can be @@ -99439,12 +104733,13 @@ async def post_by_tag( @overload async def post_by_tag( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, tag_name: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Acting on Tagged Droplets. Some actions can be performed in bulk on tagged Droplets. The actions can be @@ -99466,7 +104761,7 @@ async def post_by_tag( :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional attributes to be set as well. Default value is None. - :type body: IO + :type body: IO[bytes] :keyword tag_name: Used to filter Droplets by a specific tag. Can not be combined with ``name``. Default value is None. :paramtype tag_name: str @@ -99527,11 +104822,12 @@ async def post_by_tag( @distributed_trace_async async def post_by_tag( self, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, *, tag_name: Optional[str] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Acting on Tagged Droplets. Some actions can be performed in bulk on tagged Droplets. The actions can be @@ -99552,14 +104848,12 @@ async def post_by_tag( :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional - attributes to be set as well. Is either a model type or a IO type. Default value is None. - :type body: JSON or IO + attributes to be set as well. Is either a JSON type or a IO[bytes] type. Default value is + None. + :type body: JSON or IO[bytes] :keyword tag_name: Used to filter Droplets by a specific tag. Can not be combined with ``name``. Default value is None. :paramtype tag_name: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -99567,6 +104861,9 @@ async def post_by_tag( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "actions": [ @@ -99610,10 +104907,14 @@ async def post_by_tag( ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -99622,15 +104923,15 @@ async def post_by_tag( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -99638,7 +104939,7 @@ async def post_by_tag( else: _json = None - request = build_droplet_actions_post_by_tag_request( + _request = build_droplet_actions_post_by_tag_request( tag_name=tag_name, content_type=content_type, json=_json, @@ -99646,18 +104947,21 @@ async def post_by_tag( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -99677,12 +104981,13 @@ async def post_by_tag( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, droplet_id: int, action_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve a Droplet Action. To retrieve a Droplet action, send a GET request to @@ -99753,10 +105058,14 @@ async def get(self, droplet_id: int, action_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -99765,26 +105074,29 @@ async def get(self, droplet_id: int, action_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplet_actions_get_request( + _request = build_droplet_actions_get_request( droplet_id=droplet_id, action_id=action_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -99821,9 +105133,9 @@ async def get(self, droplet_id: int, action_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class FirewallsOperations: @@ -99847,6 +105159,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Firewalls. To list all of the firewalls available on your account, send a GET request to @@ -99865,6 +105178,9 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "firewalls": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -99979,16 +105295,17 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -99997,26 +105314,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_firewalls_list_request( + _request = build_firewalls_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -100036,9 +105356,9 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( @@ -100048,6 +105368,7 @@ async def create( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Firewall. To create a new firewall, send a POST request to ``/v2/firewalls``. The request @@ -100293,18 +105614,19 @@ async def create( @overload async def create( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Firewall. To create a new firewall, send a POST request to ``/v2/firewalls``. The request must contain at least one inbound or outbound access rule. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -100440,18 +105762,16 @@ async def create( @distributed_trace_async async def create( - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Firewall. To create a new firewall, send a POST request to ``/v2/firewalls``. The request must contain at least one inbound or outbound access rule. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -100459,6 +105779,108 @@ async def create( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the firewall was + created. + "droplet_ids": [ + 0 # Optional. An array containing the IDs of the Droplets assigned + to the firewall. + ], + "id": "str", # Optional. A unique ID that can be used to identify and + reference a firewall. + "inbound_rules": [ + { + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str", # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + "sources": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + } + } + ], + "name": "str", # Optional. A human-readable name for a firewall. The name + must begin with an alphanumeric character. Subsequent characters must either be + alphanumeric characters, a period (.), or a dash (-). + "outbound_rules": [ + { + "destinations": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + }, + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str" # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + } + ], + "pending_changes": [ + { + "droplet_id": 0, # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + "removing": bool, # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + "status": "str" # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + } + ], + "status": "str", # Optional. A status string indicating the current state of + the firewall. This can be "waiting", "succeeded", or "failed". Known values are: + "waiting", "succeeded", and "failed". + "tags": {} # Optional. Any object. + } + # response body for status code(s): 202 response == { "firewall": { @@ -100581,10 +106003,14 @@ async def create( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -100593,15 +106019,15 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -100609,25 +106035,28 @@ async def create( else: _json = None - request = build_firewalls_create_request( + _request = build_firewalls_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 400]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -100664,12 +106093,13 @@ async def create( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, firewall_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Firewall. To show information about an existing firewall, send a GET request to @@ -100807,10 +106237,14 @@ async def get(self, firewall_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -100819,25 +106253,28 @@ async def get(self, firewall_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_firewalls_get_request( + _request = build_firewalls_get_request( firewall_id=firewall_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -100874,9 +106311,9 @@ async def get(self, firewall_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update( @@ -100887,6 +106324,7 @@ async def update( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Firewall. To update the configuration of an existing firewall, send a PUT request to @@ -101138,11 +106576,12 @@ async def update( async def update( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Firewall. To update the configuration of an existing firewall, send a PUT request to @@ -101154,7 +106593,7 @@ async def update( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -101290,8 +106729,12 @@ async def update( @distributed_trace_async async def update( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Firewall. To update the configuration of an existing firewall, send a PUT request to @@ -101302,11 +106745,8 @@ async def update( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -101314,6 +106754,108 @@ async def update( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the firewall was + created. + "droplet_ids": [ + 0 # Optional. An array containing the IDs of the Droplets assigned + to the firewall. + ], + "id": "str", # Optional. A unique ID that can be used to identify and + reference a firewall. + "inbound_rules": [ + { + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str", # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + "sources": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + } + } + ], + "name": "str", # Optional. A human-readable name for a firewall. The name + must begin with an alphanumeric character. Subsequent characters must either be + alphanumeric characters, a period (.), or a dash (-). + "outbound_rules": [ + { + "destinations": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + }, + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str" # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + } + ], + "pending_changes": [ + { + "droplet_id": 0, # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + "removing": bool, # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + "status": "str" # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + } + ], + "status": "str", # Optional. A status string indicating the current state of + the firewall. This can be "waiting", "succeeded", or "failed". Known values are: + "waiting", "succeeded", and "failed". + "tags": {} # Optional. Any object. + } + # response body for status code(s): 200 response == { "firewall": { @@ -101436,10 +106978,14 @@ async def update( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101448,15 +106994,15 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -101464,7 +107010,7 @@ async def update( else: _json = None - request = build_firewalls_update_request( + _request = build_firewalls_update_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -101472,18 +107018,21 @@ async def update( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -101536,12 +107085,13 @@ async def update( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, firewall_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Firewall. To delete a firewall send a DELETE request to ``/v2/firewalls/$FIREWALL_ID``. @@ -101572,10 +107122,14 @@ async def delete(self, firewall_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101584,25 +107138,28 @@ async def delete(self, firewall_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_firewalls_delete_request( + _request = build_firewalls_delete_request( firewall_id=firewall_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -101635,9 +107192,9 @@ async def delete(self, firewall_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def assign_droplets( @@ -101648,6 +107205,7 @@ async def assign_droplets( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Firewall. To assign a Droplet to a firewall, send a POST request to @@ -101698,11 +107256,12 @@ async def assign_droplets( async def assign_droplets( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Firewall. To assign a Droplet to a firewall, send a POST request to @@ -101717,7 +107276,7 @@ async def assign_droplets( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -101743,8 +107302,12 @@ async def assign_droplets( @distributed_trace_async async def assign_droplets( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Firewall. To assign a Droplet to a firewall, send a POST request to @@ -101758,11 +107321,8 @@ async def assign_droplets( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -101770,6 +107330,14 @@ async def assign_droplets( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "droplet_ids": [ + 0 # An array containing the IDs of the Droplets to be assigned to + the firewall. Required. + ] + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -101782,10 +107350,14 @@ async def assign_droplets( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101794,15 +107366,15 @@ async def assign_droplets( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -101810,7 +107382,7 @@ async def assign_droplets( else: _json = None - request = build_firewalls_assign_droplets_request( + _request = build_firewalls_assign_droplets_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -101818,18 +107390,21 @@ async def assign_droplets( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -101878,9 +107453,9 @@ async def assign_droplets( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def delete_droplets( @@ -101891,6 +107466,7 @@ async def delete_droplets( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Firewall. To remove a Droplet from a firewall, send a DELETE request to @@ -101941,11 +107517,12 @@ async def delete_droplets( async def delete_droplets( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Firewall. To remove a Droplet from a firewall, send a DELETE request to @@ -101960,7 +107537,7 @@ async def delete_droplets( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -101986,8 +107563,12 @@ async def delete_droplets( @distributed_trace_async async def delete_droplets( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Firewall. To remove a Droplet from a firewall, send a DELETE request to @@ -102001,11 +107582,8 @@ async def delete_droplets( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -102013,6 +107591,14 @@ async def delete_droplets( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "droplet_ids": [ + 0 # An array containing the IDs of the Droplets to be removed from + the firewall. Required. + ] + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -102025,10 +107611,14 @@ async def delete_droplets( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -102037,15 +107627,15 @@ async def delete_droplets( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -102053,7 +107643,7 @@ async def delete_droplets( else: _json = None - request = build_firewalls_delete_droplets_request( + _request = build_firewalls_delete_droplets_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -102061,18 +107651,21 @@ async def delete_droplets( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -102121,9 +107714,9 @@ async def delete_droplets( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def add_tags( @@ -102134,6 +107727,7 @@ async def add_tags( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Tags to a Firewall. To assign a tag representing a group of Droplets to a firewall, send a POST @@ -102181,11 +107775,12 @@ async def add_tags( async def add_tags( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Tags to a Firewall. To assign a tag representing a group of Droplets to a firewall, send a POST @@ -102200,7 +107795,7 @@ async def add_tags( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -102226,8 +107821,12 @@ async def add_tags( @distributed_trace_async async def add_tags( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Tags to a Firewall. To assign a tag representing a group of Droplets to a firewall, send a POST @@ -102241,11 +107840,8 @@ async def add_tags( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -102253,6 +107849,11 @@ async def add_tags( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "tags": {} # Any object. Required. + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -102265,10 +107866,14 @@ async def add_tags( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -102277,15 +107882,15 @@ async def add_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -102293,7 +107898,7 @@ async def add_tags( else: _json = None - request = build_firewalls_add_tags_request( + _request = build_firewalls_add_tags_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -102301,18 +107906,21 @@ async def add_tags( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -102361,9 +107969,9 @@ async def add_tags( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def delete_tags( @@ -102374,6 +107982,7 @@ async def delete_tags( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Tags from a Firewall. To remove a tag representing a group of Droplets from a firewall, send a @@ -102421,11 +108030,12 @@ async def delete_tags( async def delete_tags( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Tags from a Firewall. To remove a tag representing a group of Droplets from a firewall, send a @@ -102440,7 +108050,7 @@ async def delete_tags( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -102466,8 +108076,12 @@ async def delete_tags( @distributed_trace_async async def delete_tags( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Tags from a Firewall. To remove a tag representing a group of Droplets from a firewall, send a @@ -102481,11 +108095,8 @@ async def delete_tags( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -102493,6 +108104,11 @@ async def delete_tags( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "tags": {} # Any object. Required. + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -102505,10 +108121,14 @@ async def delete_tags( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -102517,15 +108137,15 @@ async def delete_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -102533,7 +108153,7 @@ async def delete_tags( else: _json = None - request = build_firewalls_delete_tags_request( + _request = build_firewalls_delete_tags_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -102541,18 +108161,21 @@ async def delete_tags( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -102601,9 +108224,9 @@ async def delete_tags( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def add_rules( @@ -102614,6 +108237,7 @@ async def add_rules( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Rules to a Firewall. To add additional access rules to a firewall, send a POST request to @@ -102727,11 +108351,12 @@ async def add_rules( async def add_rules( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Rules to a Firewall. To add additional access rules to a firewall, send a POST request to @@ -102747,7 +108372,7 @@ async def add_rules( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -102773,8 +108398,12 @@ async def add_rules( @distributed_trace_async async def add_rules( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Rules to a Firewall. To add additional access rules to a firewall, send a POST request to @@ -102789,11 +108418,8 @@ async def add_rules( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -102801,6 +108427,76 @@ async def add_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "inbound_rules": [ + { + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str", # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + "sources": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + } + } + ], + "outbound_rules": [ + { + "destinations": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + }, + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str" # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + } + ] + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -102813,10 +108509,14 @@ async def add_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -102825,15 +108525,15 @@ async def add_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -102841,7 +108541,7 @@ async def add_rules( else: _json = None - request = build_firewalls_add_rules_request( + _request = build_firewalls_add_rules_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -102849,18 +108549,21 @@ async def add_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -102909,9 +108612,9 @@ async def add_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def delete_rules( @@ -102922,6 +108625,7 @@ async def delete_rules( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Rules from a Firewall. To remove access rules from a firewall, send a DELETE request to @@ -103035,11 +108739,12 @@ async def delete_rules( async def delete_rules( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Rules from a Firewall. To remove access rules from a firewall, send a DELETE request to @@ -103055,7 +108760,7 @@ async def delete_rules( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -103081,8 +108786,12 @@ async def delete_rules( @distributed_trace_async async def delete_rules( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Rules from a Firewall. To remove access rules from a firewall, send a DELETE request to @@ -103097,11 +108806,8 @@ async def delete_rules( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -103109,6 +108815,76 @@ async def delete_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "inbound_rules": [ + { + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str", # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + "sources": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + } + } + ], + "outbound_rules": [ + { + "destinations": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + }, + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str" # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + } + ] + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -103121,10 +108897,14 @@ async def delete_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103133,15 +108913,15 @@ async def delete_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -103149,7 +108929,7 @@ async def delete_rules( else: _json = None - request = build_firewalls_delete_rules_request( + _request = build_firewalls_delete_rules_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -103157,18 +108937,21 @@ async def delete_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -103217,9 +109000,9 @@ async def delete_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class FunctionsOperations: @@ -103243,6 +109026,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list_namespaces(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Namespaces. Returns a list of namespaces associated with the current user. To get all namespaces, send a @@ -103265,7 +109049,7 @@ async def list_namespaces(self, **kwargs: Any) -> JSON: "created_at": "str", # Optional. UTC time string. "key": "str", # Optional. A random alpha numeric string. This key is used in conjunction with the namespace's UUID to authenticate - "na user to use the namespace via ``doctl``"" , DigitalOcean's official + a user to use the namespace via ``doctl``"" , DigitalOcean's official CLI. "label": "str", # Optional. The namespace's unique name. "namespace": "str", # Optional. A unique string format of @@ -103279,10 +109063,14 @@ async def list_namespaces(self, **kwargs: Any) -> JSON: ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103291,24 +109079,27 @@ async def list_namespaces(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_functions_list_namespaces_request( + _request = build_functions_list_namespaces_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -103328,14 +109119,15 @@ async def list_namespaces(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_namespace( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Namespace. Creates a new serverless functions namespace in the desired region and associates it with the @@ -103370,7 +109162,62 @@ async def create_namespace( function in a namespace is provided an endpoint at the namespace's hostname. "created_at": "str", # Optional. UTC time string. "key": "str", # Optional. A random alpha numeric string. This key is - used in conjunction with the namespace's UUID to authenticate "na user to use + used in conjunction with the namespace's UUID to authenticate a user to use + the namespace via ``doctl``"" , DigitalOcean's official CLI. + "label": "str", # Optional. The namespace's unique name. + "namespace": "str", # Optional. A unique string format of UUID with + a prefix fn-. + "region": "str", # Optional. The namespace's datacenter region. + "updated_at": "str", # Optional. UTC time string. + "uuid": "str" # Optional. The namespace's Universally Unique + Identifier. + } + } + # response body for status code(s): 404, 422 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def create_namespace( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create Namespace. + + Creates a new serverless functions namespace in the desired region and associates it with the + provided label. A namespace is a collection of functions and their associated packages, + triggers, and project specifications. To create a namespace, send a POST request to + ``/v2/functions/namespaces`` with the ``region`` and ``label`` properties. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "namespace": { + "api_host": "str", # Optional. The namespace's API hostname. Each + function in a namespace is provided an endpoint at the namespace's hostname. + "created_at": "str", # Optional. UTC time string. + "key": "str", # Optional. A random alpha numeric string. This key is + used in conjunction with the namespace's UUID to authenticate a user to use the namespace via ``doctl``"" , DigitalOcean's official CLI. "label": "str", # Optional. The namespace's unique name. "namespace": "str", # Optional. A unique string format of UUID with @@ -103394,10 +109241,11 @@ async def create_namespace( } """ - @overload + @distributed_trace_async async def create_namespace( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Namespace. Creates a new serverless functions namespace in the desired region and associates it with the @@ -103405,11 +109253,8 @@ async def create_namespace( triggers, and project specifications. To create a namespace, send a POST request to ``/v2/functions/namespaces`` with the ``region`` and ``label`` properties. - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -103417,57 +109262,13 @@ async def create_namespace( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "namespace": { - "api_host": "str", # Optional. The namespace's API hostname. Each - function in a namespace is provided an endpoint at the namespace's hostname. - "created_at": "str", # Optional. UTC time string. - "key": "str", # Optional. A random alpha numeric string. This key is - used in conjunction with the namespace's UUID to authenticate "na user to use - the namespace via ``doctl``"" , DigitalOcean's official CLI. - "label": "str", # Optional. The namespace's unique name. - "namespace": "str", # Optional. A unique string format of UUID with - a prefix fn-. - "region": "str", # Optional. The namespace's datacenter region. - "updated_at": "str", # Optional. UTC time string. - "uuid": "str" # Optional. The namespace's Universally Unique - Identifier. - } - } - # response body for status code(s): 404, 422 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. + # JSON input template you can fill out and use as your body input. + body = { + "label": "str", # The namespace's unique name. Required. + "region": "str" # The `datacenter region + `_ + in which to create the namespace. Required. } - """ - - @distributed_trace_async - async def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Create Namespace. - - Creates a new serverless functions namespace in the desired region and associates it with the - provided label. A namespace is a collection of functions and their associated packages, - triggers, and project specifications. To create a namespace, send a POST request to - ``/v2/functions/namespaces`` with the ``region`` and ``label`` properties. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { @@ -103476,7 +109277,7 @@ async def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: function in a namespace is provided an endpoint at the namespace's hostname. "created_at": "str", # Optional. UTC time string. "key": "str", # Optional. A random alpha numeric string. This key is - used in conjunction with the namespace's UUID to authenticate "na user to use + used in conjunction with the namespace's UUID to authenticate a user to use the namespace via ``doctl``"" , DigitalOcean's official CLI. "label": "str", # Optional. The namespace's unique name. "namespace": "str", # Optional. A unique string format of UUID with @@ -103499,10 +109300,14 @@ async def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103511,38 +109316,41 @@ async def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_functions_create_namespace_request( + _request = build_functions_create_namespace_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404, 422]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -103595,12 +109403,13 @@ async def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Namespace. Gets the namespace details for the given namespace UUID. To get namespace details, send a GET @@ -103622,7 +109431,7 @@ async def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: function in a namespace is provided an endpoint at the namespace's hostname. "created_at": "str", # Optional. UTC time string. "key": "str", # Optional. A random alpha numeric string. This key is - used in conjunction with the namespace's UUID to authenticate "na user to use + used in conjunction with the namespace's UUID to authenticate a user to use the namespace via ``doctl``"" , DigitalOcean's official CLI. "label": "str", # Optional. The namespace's unique name. "namespace": "str", # Optional. A unique string format of UUID with @@ -103645,10 +109454,14 @@ async def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103657,25 +109470,28 @@ async def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_functions_get_namespace_request( + _request = build_functions_get_namespace_request( namespace_id=namespace_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 403, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -103728,14 +109544,15 @@ async def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_namespace( self, namespace_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Namespace. Deletes the given namespace. When a namespace is deleted all assets, in the namespace are @@ -103766,10 +109583,14 @@ async def delete_namespace( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103778,25 +109599,28 @@ async def delete_namespace( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_functions_delete_namespace_request( + _request = build_functions_delete_namespace_request( namespace_id=namespace_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -103829,12 +109653,13 @@ async def delete_namespace( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Triggers. Returns a list of triggers associated with the current user and namespace. To get all triggers, @@ -103863,12 +109688,12 @@ async def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which + is required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which - is required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run @@ -103894,10 +109719,14 @@ async def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103906,25 +109735,28 @@ async def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_functions_list_triggers_request( + _request = build_functions_list_triggers_request( namespace_id=namespace_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -103961,9 +109793,9 @@ async def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_trigger( @@ -103974,11 +109806,12 @@ async def create_trigger( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Trigger. Creates a new trigger for a given function in a namespace. To create a trigger, send a POST - request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\ , - ``function``\ , ``type``\ , ``is_enabled`` and ``scheduled_details`` properties. + request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\\ , + ``function``\\ , ``type``\\ , ``is_enabled`` and ``scheduled_details`` properties. :param namespace_id: The ID of the namespace to be managed. Required. :type namespace_id: str @@ -104002,12 +109835,12 @@ async def create_trigger( Required. "name": "str", # The trigger's unique name within the namespace. Required. "scheduled_details": { + "cron": "str", # valid cron expression string which is required for + SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is required for - SCHEDULED type triggers. Required. + } }, "type": "str" # One of different type of triggers. Currently only SCHEDULED is supported. Required. @@ -104026,12 +109859,12 @@ async def create_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -104061,21 +109894,22 @@ async def create_trigger( async def create_trigger( self, namespace_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Trigger. Creates a new trigger for a given function in a namespace. To create a trigger, send a POST - request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\ , - ``function``\ , ``type``\ , ``is_enabled`` and ``scheduled_details`` properties. + request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\\ , + ``function``\\ , ``type``\\ , ``is_enabled`` and ``scheduled_details`` properties. :param namespace_id: The ID of the namespace to be managed. Required. :type namespace_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -104099,12 +109933,12 @@ async def create_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -104132,21 +109966,19 @@ async def create_trigger( @distributed_trace_async async def create_trigger( - self, namespace_id: str, body: Union[JSON, IO], **kwargs: Any + self, namespace_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Trigger. Creates a new trigger for a given function in a namespace. To create a trigger, send a POST - request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\ , - ``function``\ , ``type``\ , ``is_enabled`` and ``scheduled_details`` properties. + request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\\ , + ``function``\\ , ``type``\\ , ``is_enabled`` and ``scheduled_details`` properties. :param namespace_id: The ID of the namespace to be managed. Required. :type namespace_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -104154,6 +109986,25 @@ async def create_trigger( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "function": "str", # Name of function(action) that exists in the given + namespace. Required. + "is_enabled": bool, # Indicates weather the trigger is paused or unpaused. + Required. + "name": "str", # The trigger's unique name within the namespace. Required. + "scheduled_details": { + "cron": "str", # valid cron expression string which is required for + SCHEDULED type triggers. Required. + "body": { + "name": "str" # Optional. Optional data to be sent to + function while triggering the function. + } + }, + "type": "str" # One of different type of triggers. Currently only SCHEDULED + is supported. Required. + } + # response body for status code(s): 200 response == { "trigger": { @@ -104167,12 +110018,12 @@ async def create_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -104197,10 +110048,14 @@ async def create_trigger( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -104209,20 +110064,20 @@ async def create_trigger( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_functions_create_trigger_request( + _request = build_functions_create_trigger_request( namespace_id=namespace_id, content_type=content_type, json=_json, @@ -104230,18 +110085,21 @@ async def create_trigger( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404, 422]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -104310,14 +110168,15 @@ async def create_trigger( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_trigger( self, namespace_id: str, trigger_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Get Trigger. Gets the trigger details. To get the trigger details, send a GET request to @@ -104347,12 +110206,12 @@ async def get_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -104377,10 +110236,14 @@ async def get_trigger( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -104389,26 +110252,29 @@ async def get_trigger( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_functions_get_trigger_request( + _request = build_functions_get_trigger_request( namespace_id=namespace_id, trigger_name=trigger_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -104445,9 +110311,9 @@ async def get_trigger( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_trigger( @@ -104459,6 +110325,7 @@ async def update_trigger( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Trigger. Updates the details of the given trigger. To update a trigger, send a PUT request to @@ -104486,12 +110353,12 @@ async def update_trigger( "is_enabled": bool, # Optional. Indicates weather the trigger is paused or unpaused. "scheduled_details": { + "cron": "str", # valid cron expression string which is required for + SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is required for - SCHEDULED type triggers. Required. + } } } @@ -104508,12 +110375,12 @@ async def update_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -104544,11 +110411,12 @@ async def update_trigger( self, namespace_id: str, trigger_name: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Trigger. Updates the details of the given trigger. To update a trigger, send a PUT request to @@ -104560,7 +110428,7 @@ async def update_trigger( :param trigger_name: The name of the trigger to be managed. Required. :type trigger_name: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -104584,12 +110452,12 @@ async def update_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -104617,8 +110485,13 @@ async def update_trigger( @distributed_trace_async async def update_trigger( - self, namespace_id: str, trigger_name: str, body: Union[JSON, IO], **kwargs: Any + self, + namespace_id: str, + trigger_name: str, + body: Union[JSON, IO[bytes]], + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Trigger. Updates the details of the given trigger. To update a trigger, send a PUT request to @@ -104629,11 +110502,8 @@ async def update_trigger( :type namespace_id: str :param trigger_name: The name of the trigger to be managed. Required. :type trigger_name: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -104641,6 +110511,20 @@ async def update_trigger( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "is_enabled": bool, # Optional. Indicates weather the trigger is paused or + unpaused. + "scheduled_details": { + "cron": "str", # valid cron expression string which is required for + SCHEDULED type triggers. Required. + "body": { + "name": "str" # Optional. Optional data to be sent to + function while triggering the function. + } + } + } + # response body for status code(s): 200 response == { "trigger": { @@ -104654,12 +110538,12 @@ async def update_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -104684,10 +110568,14 @@ async def update_trigger( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -104696,20 +110584,20 @@ async def update_trigger( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_functions_update_trigger_request( + _request = build_functions_update_trigger_request( namespace_id=namespace_id, trigger_name=trigger_name, content_type=content_type, @@ -104718,18 +110606,21 @@ async def update_trigger( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -104782,14 +110673,15 @@ async def update_trigger( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_trigger( self, namespace_id: str, trigger_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Trigger. Deletes the given trigger. @@ -104820,10 +110712,14 @@ async def delete_trigger( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -104832,26 +110728,29 @@ async def delete_trigger( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_functions_delete_trigger_request( + _request = build_functions_delete_trigger_request( namespace_id=namespace_id, trigger_name=trigger_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -104884,9 +110783,9 @@ async def delete_trigger( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class ImagesOperations: @@ -104919,6 +110818,7 @@ async def list( page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Images. To list all of the images available on your account, send a GET request to /v2/images. @@ -104940,10 +110840,10 @@ async def list( Important: The ``type`` query parameter does not directly relate to the ``type`` attribute. - To retrieve only **\ *distribution*\ ** images, include the ``type`` query parameter set to + To retrieve only **\\ *distribution*\\ ** images, include the ``type`` query parameter set to distribution, ``/v2/images?type=distribution``. - To retrieve only **\ *application*\ ** images, include the ``type`` query parameter set to + To retrieve only **\\ *application*\\ ** images, include the ``type`` query parameter set to application, ``/v2/images?type=application``. **User Images** @@ -104993,7 +110893,7 @@ async def list( "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing - information about errors that may occur when importing"n a custom image. + information about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB @@ -105017,7 +110917,7 @@ async def list( These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the - state of a custom image. This may be ``NEW``"" ,"n ``available``"" , + state of a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -105035,18 +110935,22 @@ async def list( and "admin". } ], - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. + }, + "links": { + "pages": {} } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105055,9 +110959,9 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_images_list_request( + _request = build_images_list_request( type=type, private=private, tag_name=tag_name, @@ -105066,18 +110970,21 @@ async def list( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -105097,14 +111004,15 @@ async def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_custom( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Custom Image. To create a new custom image, send a POST request to /v2/images. @@ -105128,6 +111036,14 @@ async def create_custom( # JSON input template you can fill out and use as your body input. body = { + "region": "str", # The slug identifier for the region where the resource + will initially be available. Required. Known values are: "ams1", "ams2", "ams3", + "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", "sfo2", "sfo3", "sgp1", + and "tor1". + "url": "str", # A URL from which the custom Linux virtual machine image may + be retrieved. The image it points to must be in the raw, qcow2, vhdx, vdi, or + vmdk format. It may be compressed using gzip or bzip2 and must be smaller than + 100 GB after being decompressed. Required. "description": "str", # Optional. An optional free-form text field to describe an image. "distribution": "str", # Optional. The name of a custom image's @@ -105141,18 +111057,10 @@ async def create_custom( "name": "str", # Optional. The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question. - "region": "str", # The slug identifier for the region where the resource - will initially be available. Required. Known values are: "ams1", "ams2", "ams3", - "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", "sfo2", "sfo3", "sgp1", - and "tor1". "tags": [ "str" # Optional. A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. - ], - "url": "str" # A URL from which the custom Linux virtual machine image may - be retrieved. The image it points to must be in the raw, qcow2, vhdx, vdi, or - vmdk format. It may be compressed using gzip or bzip2 and must be smaller than - 100 GB after being decompressed. Required. + ] } # response body for status code(s): 202 @@ -105173,7 +111081,7 @@ async def create_custom( Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -105196,7 +111104,7 @@ async def create_custom( associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -105217,8 +111125,9 @@ async def create_custom( @overload async def create_custom( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Custom Image. To create a new custom image, send a POST request to /v2/images. @@ -105229,7 +111138,7 @@ async def create_custom( being decompressed. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -105258,7 +111167,7 @@ async def create_custom( Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -105281,7 +111190,7 @@ async def create_custom( associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -105301,7 +111210,8 @@ async def create_custom( """ @distributed_trace_async - async def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create_custom(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a Custom Image. To create a new custom image, send a POST request to /v2/images. @@ -105311,11 +111221,8 @@ async def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -105323,6 +111230,35 @@ async def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "region": "str", # The slug identifier for the region where the resource + will initially be available. Required. Known values are: "ams1", "ams2", "ams3", + "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", "sfo2", "sfo3", "sgp1", + and "tor1". + "url": "str", # A URL from which the custom Linux virtual machine image may + be retrieved. The image it points to must be in the raw, qcow2, vhdx, vdi, or + vmdk format. It may be compressed using gzip or bzip2 and must be smaller than + 100 GB after being decompressed. Required. + "description": "str", # Optional. An optional free-form text field to + describe an image. + "distribution": "str", # Optional. The name of a custom image's + distribution. Currently, the valid values are ``Arch Linux``"" , ``CentOS``"" , + ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora Atomic``"" , ``FreeBSD``"" + , ``Gentoo``"" , ``openSUSE``"" , ``RancherOS``"" , ``Rocky Linux``"" , + ``Ubuntu``"" , and ``Unknown``. Any other value will be accepted but ignored, + and ``Unknown`` will be used in its place. Known values are: "Arch Linux", + "CentOS", "CoreOS", "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", + "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". + "name": "str", # Optional. The display name that has been given to an image. + This is what is shown in the control panel and is generally a descriptive title + for the image in question. + "tags": [ + "str" # Optional. A flat array of tag names as strings to be applied + to the resource. Tag names may be for either existing or new tags. + ] + } + # response body for status code(s): 202 response == { "image": { @@ -105341,7 +111277,7 @@ async def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -105364,7 +111300,7 @@ async def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -105382,10 +111318,14 @@ async def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105394,38 +111334,41 @@ async def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_images_create_custom_request( + _request = build_images_create_custom_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -105445,12 +111388,13 @@ async def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, image_id: JSON, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Image. To retrieve information about an image, send a ``GET`` request to @@ -105488,7 +111432,7 @@ async def get(self, image_id: JSON, **kwargs: Any) -> JSON: Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -105511,7 +111455,7 @@ async def get(self, image_id: JSON, **kwargs: Any) -> JSON: associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -105540,10 +111484,14 @@ async def get(self, image_id: JSON, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105552,25 +111500,28 @@ async def get(self, image_id: JSON, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_images_get_request( + _request = build_images_get_request( image_id=image_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -105607,9 +111558,9 @@ async def get(self, image_id: JSON, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update( @@ -105620,6 +111571,7 @@ async def update( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Image. To update an image, send a ``PUT`` request to ``/v2/images/$IMAGE_ID``. @@ -105676,7 +111628,7 @@ async def update( Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -105699,7 +111651,7 @@ async def update( associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -105733,11 +111685,12 @@ async def update( async def update( self, image_id: int, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Image. To update an image, send a ``PUT`` request to ``/v2/images/$IMAGE_ID``. @@ -105748,7 +111701,7 @@ async def update( Required. :type image_id: int :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -105777,7 +111730,7 @@ async def update( Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -105800,7 +111753,7 @@ async def update( associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -105831,7 +111784,10 @@ async def update( """ @distributed_trace_async - async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def update( + self, image_id: int, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Update an Image. To update an image, send a ``PUT`` request to ``/v2/images/$IMAGE_ID``. @@ -105841,11 +111797,8 @@ async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> J :param image_id: A unique number that can be used to identify and reference a specific image. Required. :type image_id: int - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -105853,6 +111806,23 @@ async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> J Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "description": "str", # Optional. An optional free-form text field to + describe an image. + "distribution": "str", # Optional. The name of a custom image's + distribution. Currently, the valid values are ``Arch Linux``"" , ``CentOS``"" , + ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora Atomic``"" , ``FreeBSD``"" + , ``Gentoo``"" , ``openSUSE``"" , ``RancherOS``"" , ``Rocky Linux``"" , + ``Ubuntu``"" , and ``Unknown``. Any other value will be accepted but ignored, + and ``Unknown`` will be used in its place. Known values are: "Arch Linux", + "CentOS", "CoreOS", "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", + "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". + "name": "str" # Optional. The display name that has been given to an image. + This is what is shown in the control panel and is generally a descriptive title + for the image in question. + } + # response body for status code(s): 200 response == { "image": { @@ -105871,7 +111841,7 @@ async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> J Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -105894,7 +111864,7 @@ async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> J associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -105923,10 +111893,14 @@ async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> J tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105935,20 +111909,20 @@ async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> J _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_images_update_request( + _request = build_images_update_request( image_id=image_id, content_type=content_type, json=_json, @@ -105956,18 +111930,21 @@ async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> J headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -106004,12 +111981,13 @@ async def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> J deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, image_id: int, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Image. To delete a snapshot or custom image, send a ``DELETE`` request to ``/v2/images/$IMAGE_ID``. @@ -106036,10 +112014,14 @@ async def delete(self, image_id: int, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106048,25 +112030,28 @@ async def delete(self, image_id: int, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_images_delete_request( + _request = build_images_delete_request( image_id=image_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -106099,9 +112084,9 @@ async def delete(self, image_id: int, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class ImageActionsOperations: @@ -106125,6 +112110,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, image_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Actions for an Image. To retrieve all actions that have been executed on an image, send a GET request to @@ -106142,6 +112128,9 @@ async def list(self, image_id: int, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -106183,9 +112172,6 @@ async def list(self, image_id: int, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -106200,10 +112186,14 @@ async def list(self, image_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106212,25 +112202,28 @@ async def list(self, image_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_image_actions_list_request( + _request = build_image_actions_list_request( image_id=image_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -106267,9 +112260,9 @@ async def list(self, image_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def post( @@ -106280,6 +112273,7 @@ async def post( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate an Image Action. The following actions are available on an Image. @@ -106367,11 +112361,12 @@ async def post( async def post( self, image_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate an Image Action. The following actions are available on an Image. @@ -106394,7 +112389,7 @@ async def post( Required. :type image_id: int :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -106454,8 +112449,12 @@ async def post( @distributed_trace_async async def post( - self, image_id: int, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + image_id: int, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate an Image Action. The following actions are available on an Image. @@ -106477,11 +112476,8 @@ async def post( :param image_id: A unique number that can be used to identify and reference a specific image. Required. :type image_id: int - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -106489,6 +112485,9 @@ async def post( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "completed_at": "2020-02-20 00:00:00", # Optional. A time value given in @@ -106535,10 +112534,14 @@ async def post( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106547,15 +112550,15 @@ async def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -106563,7 +112566,7 @@ async def post( else: _json = None - request = build_image_actions_post_request( + _request = build_image_actions_post_request( image_id=image_id, content_type=content_type, json=_json, @@ -106571,18 +112574,21 @@ async def post( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -106619,12 +112625,13 @@ async def post( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, image_id: int, action_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Action. To retrieve the status of an image action, send a GET request to @@ -106689,10 +112696,14 @@ async def get(self, image_id: int, action_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106701,26 +112712,29 @@ async def get(self, image_id: int, action_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_image_actions_get_request( + _request = build_image_actions_get_request( image_id=image_id, action_id=action_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -106757,9 +112771,9 @@ async def get(self, image_id: int, action_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class KubernetesOperations: # pylint: disable=too-many-public-methods @@ -106785,6 +112799,7 @@ def __init__(self, *args, **kwargs) -> None: async def list_clusters( self, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Kubernetes Clusters. To list all of the Kubernetes clusters on your account, send a GET request @@ -106803,40 +112818,11 @@ async def list_clusters( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "kubernetes_clusters": [ { - "auto_upgrade": False, # Optional. Default value is False. A - boolean value indicating whether the cluster will be automatically - upgraded to new patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP - addresses in the overlay network of the Kubernetes cluster in CIDR - notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time - value given in ISO8601 combined date and time format that represents when - the Kubernetes cluster was created. - "endpoint": "str", # Optional. The base URL of the API - server on the Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean - value indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to - identify and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the - Kubernetes master node. This will not be set if high availability is - configured on the cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance - window policy. May be one of ``monday`` through ``sunday``"" , or - ``any`` to indicate an arbitrary week day. Known values are: "any", - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", - and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in - UTC of the maintenance window policy in 24-hour clock format / HH:MM - notation (e.g., ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -106921,6 +112907,44 @@ async def list_clusters( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), + the latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available + versions. Required. + "auto_upgrade": False, # Optional. Default value is False. A + boolean value indicating whether the cluster will be automatically + upgraded to new patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP + addresses in the overlay network of the Kubernetes cluster in CIDR + notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the Kubernetes cluster was created. + "endpoint": "str", # Optional. The base URL of the API + server on the Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean + value indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to + identify and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the + Kubernetes master node. This will not be set if high availability is + configured on the cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance + window policy. May be one of ``monday`` through ``sunday``"" , or + ``any`` to indicate an arbitrary week day. Known values are: "any", + "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", + and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in + UTC of the maintenance window policy in 24-hour clock format / HH:MM + notation (e.g., ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable @@ -106946,28 +112970,23 @@ async def list_clusters( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), - the latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available - versions. Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106976,26 +112995,29 @@ async def list_clusters( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_list_clusters_request( + _request = build_kubernetes_list_clusters_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -107015,14 +113037,15 @@ async def list_clusters( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_cluster( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Kubernetes Cluster. To create a new Kubernetes cluster, send a POST request to @@ -107049,36 +113072,6 @@ async def create_cluster( # JSON input template you can fill out and use as your body input. body = { - "auto_upgrade": False, # Optional. Default value is False. A boolean value - indicating whether the cluster will be automatically upgraded to new patch - releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in the - overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given in - ISO8601 combined date and time format that represents when the Kubernetes cluster - was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value indicating - whether the control plane is run in a highly available configuration in the - cluster. Highly available control planes incur less downtime. The property cannot - be disabled. - "id": "str", # Optional. A unique ID that can be used to identify and - reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes master - node. This will not be set if high availability is configured on the cluster - (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window policy. - May be one of ``monday`` through ``sunday``"" , or ``any`` to indicate an - arbitrary week day. Known values are: "any", "monday", "tuesday", - "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the maintenance - window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ { @@ -107152,6 +113145,41 @@ async def create_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of Kubernetes used + for the cluster. If set to a minor version (e.g. "1.14"), the latest version + within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest + published version will be used. See the ``/v2/kubernetes/options`` endpoint to + find all currently available versions. Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether the cluster will be automatically upgraded to new patch + releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in the + overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the Kubernetes cluster + was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value indicating + whether the control plane is run in a highly available configuration in the + cluster. Highly available control planes incur less downtime. The property cannot + be disabled. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes master + node. This will not be set if high availability is configured on the cluster + (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window policy. + May be one of ``monday`` through ``sunday``"" , or ``any`` to indicate an + arbitrary week day. Known values are: "any", "monday", "tuesday", + "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the maintenance + window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP addresses @@ -107175,11 +113203,6 @@ async def create_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of Kubernetes used - for the cluster. If set to a minor version (e.g. "1.14"), the latest version - within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest - published version will be used. See the ``/v2/kubernetes/options`` endpoint to - find all currently available versions. Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -107187,36 +113210,6 @@ async def create_cluster( # response body for status code(s): 201 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -107295,6 +113288,42 @@ async def create_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -107318,12 +113347,6 @@ async def create_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -107332,8 +113355,9 @@ async def create_cluster( @overload async def create_cluster( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Kubernetes Cluster. To create a new Kubernetes cluster, send a POST request to @@ -107347,7 +113371,7 @@ async def create_cluster( for details. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -107361,36 +113385,6 @@ async def create_cluster( # response body for status code(s): 201 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -107469,6 +113463,42 @@ async def create_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -107492,12 +113522,6 @@ async def create_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -107505,7 +113529,8 @@ async def create_cluster( """ @distributed_trace_async - async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Kubernetes Cluster. To create a new Kubernetes cluster, send a POST request to @@ -107518,11 +113543,8 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: `here `_ for details. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -107530,39 +113552,146 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A human-readable name for a Kubernetes cluster. Required. + "node_pools": [ + { + "auto_scale": bool, # Optional. A boolean value indicating + whether auto-scaling is enabled for this node pool. + "count": 0, # Optional. The number of Droplet instances in + the node pool. + "id": "str", # Optional. A unique ID that can be used to + identify and reference a specific node pool. + "labels": {}, # Optional. An object of key/value mappings + specifying labels to apply to all nodes in a pool. Labels will + automatically be applied to all existing nodes and any subsequent nodes + added to the pool. Note that when a label is removed, it is not deleted + from the nodes in the pool. + "max_nodes": 0, # Optional. The maximum number of nodes that + this node pool can be auto-scaled to. The value will be ``0`` if + ``auto_scale`` is set to ``false``. + "min_nodes": 0, # Optional. The minimum number of nodes that + this node pool can be auto-scaled to. The value will be ``0`` if + ``auto_scale`` is set to ``false``. + "name": "str", # Optional. A human-readable name for the + node pool. + "nodes": [ + { + "created_at": "2020-02-20 00:00:00", # + Optional. A time value given in ISO8601 combined date and time + format that represents when the node was created. + "droplet_id": "str", # Optional. The ID of + the Droplet used for the worker node. + "id": "str", # Optional. A unique ID that + can be used to identify and reference the node. + "name": "str", # Optional. An automatically + generated, human-readable name for the node. + "status": { + "state": "str" # Optional. A string + indicating the current status of the node. Known values are: + "provisioning", "running", "draining", and "deleting". + }, + "updated_at": "2020-02-20 00:00:00" # + Optional. A time value given in ISO8601 combined date and time + format that represents when the node was last updated. + } + ], + "size": "str", # Optional. The slug identifier for the type + of Droplet used as workers in the node pool. + "tags": [ + "str" # Optional. An array containing the tags + applied to the node pool. All node pools are automatically tagged + ``k8s``"" , ``k8s-worker``"" , and ``k8s:$K8S_CLUSTER_ID``. + ], + "taints": [ + { + "effect": "str", # Optional. How the node + reacts to pods that it won't tolerate. Available effect values + are ``NoSchedule``"" , ``PreferNoSchedule``"" , and + ``NoExecute``. Known values are: "NoSchedule", + "PreferNoSchedule", and "NoExecute". + "key": "str", # Optional. An arbitrary + string. The ``key`` and ``value`` fields of the ``taint`` object + form a key-value pair. For example, if the value of the ``key`` + field is "special" and the value of the ``value`` field is "gpu", + the key value pair would be ``special=gpu``. + "value": "str" # Optional. An arbitrary + string. The ``key`` and ``value`` fields of the ``taint`` object + form a key-value pair. For example, if the value of the ``key`` + field is "special" and the value of the ``value`` field is "gpu", + the key value pair would be ``special=gpu``. + } + ] + } + ], + "region": "str", # The slug identifier for the region where the Kubernetes + cluster is located. Required. + "version": "str", # The slug identifier for the version of Kubernetes used + for the cluster. If set to a minor version (e.g. "1.14"), the latest version + within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest + published version will be used. See the ``/v2/kubernetes/options`` endpoint to + find all currently available versions. Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether the cluster will be automatically upgraded to new patch + releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in the + overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the Kubernetes cluster + was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value indicating + whether the control plane is run in a highly available configuration in the + cluster. Highly available control planes incur less downtime. The property cannot + be disabled. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes master + node. This will not be set if high availability is configured on the cluster + (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window policy. + May be one of ``monday`` through ``sunday``"" , or ``any`` to indicate an + arbitrary week day. Known values are: "any", "monday", "tuesday", + "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the maintenance + window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, + "registry_enabled": bool, # Optional. A read-only boolean value indicating + if a container registry is integrated with the cluster. + "service_subnet": "str", # Optional. The range of assignable IP addresses + for services running in the Kubernetes cluster in CIDR notation. + "status": { + "message": "str", # Optional. An optional message providing + additional information about the current cluster state. + "state": "str" # Optional. A string indicating the current status of + the cluster. Known values are: "running", "provisioning", "degraded", + "error", "deleted", "upgrading", and "deleting". + }, + "surge_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether surge upgrade is enabled/disabled for the cluster. Surge + upgrade makes cluster upgrades fast and reliable by bringing up new nodes before + destroying the outdated nodes. + "tags": [ + "str" # Optional. An array of tags applied to the Kubernetes + cluster. All clusters are automatically tagged ``k8s`` and + ``k8s:$K8S_CLUSTER_ID``. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the Kubernetes cluster + was last updated. + "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to + which the Kubernetes cluster is assigned. + } + # response body for status code(s): 201 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -107641,6 +113770,42 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -107664,21 +113829,19 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -107687,38 +113850,41 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_create_cluster_request( + _request = build_kubernetes_create_cluster_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -107738,12 +113904,13 @@ async def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Kubernetes Cluster. To show information about an existing Kubernetes cluster, send a GET request @@ -107761,36 +113928,6 @@ async def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -107869,6 +114006,42 @@ async def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -107892,12 +114065,6 @@ async def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -107914,10 +114081,14 @@ async def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -107926,25 +114097,28 @@ async def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_cluster_request( + _request = build_kubernetes_get_cluster_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -107981,9 +114155,9 @@ async def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_cluster( @@ -107994,6 +114168,7 @@ async def update_cluster( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Kubernetes Cluster. To update a Kubernetes cluster, send a PUT request to @@ -108016,6 +114191,7 @@ async def update_cluster( # JSON input template you can fill out and use as your body input. body = { + "name": "str", # A human-readable name for a Kubernetes cluster. Required. "auto_upgrade": False, # Optional. Default value is False. A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window. @@ -108034,7 +114210,6 @@ async def update_cluster( maintenance window policy in 24-hour clock format / HH:MM notation (e.g., ``15:00``"" ). }, - "name": "str", # A human-readable name for a Kubernetes cluster. Required. "surge_upgrade": False, # Optional. Default value is False. A boolean value indicating whether surge upgrade is enabled/disabled for the cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing up new nodes before @@ -108049,36 +114224,6 @@ async def update_cluster( # response body for status code(s): 202 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -108157,6 +114302,42 @@ async def update_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -108180,12 +114361,6 @@ async def update_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -108207,11 +114382,12 @@ async def update_cluster( async def update_cluster( self, cluster_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Kubernetes Cluster. To update a Kubernetes cluster, send a PUT request to @@ -108221,7 +114397,7 @@ async def update_cluster( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -108235,36 +114411,6 @@ async def update_cluster( # response body for status code(s): 202 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -108343,79 +114489,12 @@ async def update_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. - "registry_enabled": bool, # Optional. A read-only boolean value - indicating if a container registry is integrated with the cluster. - "service_subnet": "str", # Optional. The range of assignable IP - addresses for services running in the Kubernetes cluster in CIDR notation. - "status": { - "message": "str", # Optional. An optional message providing - additional information about the current cluster state. - "state": "str" # Optional. A string indicating the current - status of the cluster. Known values are: "running", "provisioning", - "degraded", "error", "deleted", "upgrading", and "deleting". - }, - "surge_upgrade": False, # Optional. Default value is False. A - boolean value indicating whether surge upgrade is enabled/disabled for the - cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing - up new nodes before destroying the outdated nodes. - "tags": [ - "str" # Optional. An array of tags applied to the Kubernetes - cluster. All clusters are automatically tagged ``k8s`` and - ``k8s:$K8S_CLUSTER_ID``. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was last updated. "version": "str", # The slug identifier for the version of Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the latest version within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest published version will be used. See the ``/v2/kubernetes/options`` endpoint to find all currently available versions. Required. - "vpc_uuid": "str" # Optional. A string specifying the UUID of the - VPC to which the Kubernetes cluster is assigned. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace_async - async def update_cluster( - self, cluster_id: str, body: Union[JSON, IO], **kwargs: Any - ) -> JSON: - """Update a Kubernetes Cluster. - - To update a Kubernetes cluster, send a PUT request to - ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID`` and specify one or more of the - attributes below. - - :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. - :type cluster_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 202 - response == { - "kubernetes_cluster": { "auto_upgrade": False, # Optional. Default value is False. A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window. @@ -108446,6 +114525,103 @@ async def update_cluster( maintenance window policy in 24-hour clock format / HH:MM notation (e.g., ``15:00``"" ). }, + "registry_enabled": bool, # Optional. A read-only boolean value + indicating if a container registry is integrated with the cluster. + "service_subnet": "str", # Optional. The range of assignable IP + addresses for services running in the Kubernetes cluster in CIDR notation. + "status": { + "message": "str", # Optional. An optional message providing + additional information about the current cluster state. + "state": "str" # Optional. A string indicating the current + status of the cluster. Known values are: "running", "provisioning", + "degraded", "error", "deleted", "upgrading", and "deleting". + }, + "surge_upgrade": False, # Optional. Default value is False. A + boolean value indicating whether surge upgrade is enabled/disabled for the + cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing + up new nodes before destroying the outdated nodes. + "tags": [ + "str" # Optional. An array of tags applied to the Kubernetes + cluster. All clusters are automatically tagged ``k8s`` and + ``k8s:$K8S_CLUSTER_ID``. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was last updated. + "vpc_uuid": "str" # Optional. A string specifying the UUID of the + VPC to which the Kubernetes cluster is assigned. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def update_cluster( + self, cluster_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update a Kubernetes Cluster. + + To update a Kubernetes cluster, send a PUT request to + ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID`` and specify one or more of the + attributes below. + + :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. + :type cluster_id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A human-readable name for a Kubernetes cluster. Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether the cluster will be automatically upgraded to new patch + releases during its maintenance window. + "ha": False, # Optional. Default value is False. A boolean value indicating + whether the control plane is run in a highly available configuration in the + cluster. Highly available control planes incur less downtime. The property cannot + be disabled. + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window policy. + May be one of ``monday`` through ``sunday``"" , or ``any`` to indicate an + arbitrary week day. Known values are: "any", "monday", "tuesday", + "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the maintenance + window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, + "surge_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether surge upgrade is enabled/disabled for the cluster. Surge + upgrade makes cluster upgrades fast and reliable by bringing up new nodes before + destroying the outdated nodes. + "tags": [ + "str" # Optional. An array of tags applied to the Kubernetes + cluster. All clusters are automatically tagged ``k8s`` and + ``k8s:$K8S_CLUSTER_ID``. + ] + } + + # response body for status code(s): 202 + response == { + "kubernetes_cluster": { "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -108524,6 +114700,42 @@ async def update_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -108547,12 +114759,6 @@ async def update_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -108569,10 +114775,14 @@ async def update_cluster( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -108581,20 +114791,20 @@ async def update_cluster( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_update_cluster_request( + _request = build_kubernetes_update_cluster_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -108602,18 +114812,21 @@ async def update_cluster( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -108650,12 +114863,13 @@ async def update_cluster( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_cluster(self, cluster_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Kubernetes Cluster. To delete a Kubernetes cluster and all services deployed to it, send a DELETE @@ -108685,10 +114899,14 @@ async def delete_cluster(self, cluster_id: str, **kwargs: Any) -> Optional[JSON] tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -108697,25 +114915,28 @@ async def delete_cluster(self, cluster_id: str, **kwargs: Any) -> Optional[JSON] _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_delete_cluster_request( + _request = build_kubernetes_delete_cluster_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -108748,12 +114969,13 @@ async def delete_cluster(self, cluster_id: str, **kwargs: Any) -> Optional[JSON] deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_associated_resources(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Associated Resources for Cluster Deletion. To list the associated billable resources that can be destroyed along with a cluster, send a @@ -108808,10 +115030,14 @@ async def list_associated_resources(self, cluster_id: str, **kwargs: Any) -> JSO tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -108820,25 +115046,28 @@ async def list_associated_resources(self, cluster_id: str, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_list_associated_resources_request( + _request = build_kubernetes_list_associated_resources_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -108875,9 +115104,9 @@ async def list_associated_resources(self, cluster_id: str, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def destroy_associated_resources_selective( @@ -108888,13 +115117,14 @@ async def destroy_associated_resources_selective( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Delete a Cluster and its Associated Resources. To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective``. - The JSON body of the request should include ``load_balancers``\ , ``volumes``\ , or + The JSON body of the request should include ``load_balancers``\\ , ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. @@ -108949,18 +115179,19 @@ async def destroy_associated_resources_selective( async def destroy_associated_resources_selective( self, cluster_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Delete a Cluster and its Associated Resources. To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective``. - The JSON body of the request should include ``load_balancers``\ , ``volumes``\ , or + The JSON body of the request should include ``load_balancers``\\ , ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. @@ -108971,7 +115202,7 @@ async def destroy_associated_resources_selective( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -108997,15 +115228,16 @@ async def destroy_associated_resources_selective( @distributed_trace_async async def destroy_associated_resources_selective( - self, cluster_id: str, body: Union[JSON, IO], **kwargs: Any + self, cluster_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Delete a Cluster and its Associated Resources. To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective``. - The JSON body of the request should include ``load_balancers``\ , ``volumes``\ , or + The JSON body of the request should include ``load_balancers``\\ , ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. @@ -109015,11 +115247,8 @@ async def destroy_associated_resources_selective( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -109027,6 +115256,22 @@ async def destroy_associated_resources_selective( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "load_balancers": [ + "str" # Optional. A list of IDs for associated load balancers to + destroy along with the cluster. + ], + "volume_snapshots": [ + "str" # Optional. A list of IDs for associated volume snapshots to + destroy along with the cluster. + ], + "volumes": [ + "str" # Optional. A list of IDs for associated volumes to destroy + along with the cluster. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -109039,10 +115284,14 @@ async def destroy_associated_resources_selective( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109051,20 +115300,20 @@ async def destroy_associated_resources_selective( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_destroy_associated_resources_selective_request( + _request = build_kubernetes_destroy_associated_resources_selective_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -109072,18 +115321,21 @@ async def destroy_associated_resources_selective( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -109116,14 +115368,15 @@ async def destroy_associated_resources_selective( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def destroy_associated_resources_dangerous( self, cluster_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Cluster and All of its Associated Resources (Dangerous). To delete a Kubernetes cluster with all of its associated resources, send a @@ -109152,10 +115405,14 @@ async def destroy_associated_resources_dangerous( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109164,25 +115421,28 @@ async def destroy_associated_resources_dangerous( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_destroy_associated_resources_dangerous_request( + _request = build_kubernetes_destroy_associated_resources_dangerous_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -109215,25 +115475,26 @@ async def destroy_associated_resources_dangerous( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_kubeconfig( self, cluster_id: str, *, expiry_seconds: int = 0, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Retrieve the kubeconfig for a Kubernetes Cluster. This endpoint returns a kubeconfig file in YAML format. It can be used to connect to and administer the cluster using the Kubernetes command line tool, - ``kubectl``\ , or other programs supporting kubeconfig files (e.g., client libraries). + ``kubectl``\\ , or other programs supporting kubeconfig files (e.g., client libraries). The resulting kubeconfig file uses token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of - supported versions and more information, see "\ `How to Connect to a DigitalOcean + supported versions and more information, see "\\ `How to Connect to a DigitalOcean Kubernetes Cluster with kubectl - `_\ ". + `_\\ ". To retrieve a kubeconfig file for use with a Kubernetes cluster, send a GET request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig``. @@ -109268,10 +115529,14 @@ async def get_kubeconfig( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109280,26 +115545,29 @@ async def get_kubeconfig( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_get_kubeconfig_request( + _request = build_kubernetes_get_kubeconfig_request( cluster_id=cluster_id, expiry_seconds=expiry_seconds, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -109332,14 +115600,15 @@ async def get_kubeconfig( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_credentials( self, cluster_id: str, *, expiry_seconds: int = 0, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Credentials for a Kubernetes Cluster. This endpoint returns a JSON object . It can be used to programmatically @@ -109347,9 +115616,9 @@ async def get_credentials( The resulting JSON object contains token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of - supported versions and more information, see "\ `How to Connect to a DigitalOcean + supported versions and more information, see "\\ `How to Connect to a DigitalOcean Kubernetes Cluster with kubectl - `_\ ". + `_\\ ". To retrieve credentials for accessing a Kubernetes cluster, send a GET request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials``. @@ -109378,17 +115647,16 @@ async def get_credentials( A base64 encoding of bytes representing the certificate authority data for accessing the cluster. "client_certificate_data": bytes("bytes", encoding="utf-8"), # Optional. A - base64 encoding of bytes representing the x509 client"ncertificate data for - access the cluster. This is only returned for clusters"nwithout support for - token-based authentication."n"nNewly created Kubernetes clusters do not return - credentials using"ncertificate-based authentication. For additional - information,"n`see here + base64 encoding of bytes representing the x509 client certificate data for access + the cluster. This is only returned for clusters without support for token-based + authentication. Newly created Kubernetes clusters do not return credentials + using certificate-based authentication. For additional information, `see here `_. "client_key_data": bytes("bytes", encoding="utf-8"), # Optional. A base64 - encoding of bytes representing the x509 client key"ndata for access the cluster. - This is only returned for clusters without"nsupport for token-based - authentication."n"nNewly created Kubernetes clusters do not return credentials - using"ncertificate-based authentication. For additional information,"n`see here + encoding of bytes representing the x509 client key data for access the cluster. + This is only returned for clusters without support for token-based + authentication. Newly created Kubernetes clusters do not return credentials + using certificate-based authentication. For additional information, `see here `_. "expires_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the access token @@ -109410,10 +115678,140 @@ async def get_credentials( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_kubernetes_get_credentials_request( + cluster_id=cluster_id, + expiry_seconds=expiry_seconds, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_available_upgrades(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve Available Upgrades for an Existing Kubernetes Cluster. + + To determine whether a cluster can be upgraded, and the versions to which it + can be upgraded, send a GET request to + ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades``. + + :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. + :type cluster_id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "available_upgrade_versions": [ + { + "kubernetes_version": "str", # Optional. The upstream + version string for the version of Kubernetes provided by a given slug. + "slug": "str", # Optional. The slug identifier for an + available version of Kubernetes for use when creating or updating a + cluster. The string contains both the upstream version of Kubernetes as + well as the DigitalOcean revision. + "supported_features": [ + "str" # Optional. The features available with the + version of Kubernetes provided by a given slug. + ] + } + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109422,143 +115820,28 @@ async def get_credentials( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_credentials_request( + _request = build_kubernetes_get_available_upgrades_request( cluster_id=cluster_id, - expiry_seconds=expiry_seconds, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) + _request.url = self._client.format_url(_request.url) - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def get_available_upgrades(self, cluster_id: str, **kwargs: Any) -> JSON: - """Retrieve Available Upgrades for an Existing Kubernetes Cluster. - - To determine whether a cluster can be upgraded, and the versions to which it - can be upgraded, send a GET request to - ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades``. - - :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. - :type cluster_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "available_upgrade_versions": [ - { - "kubernetes_version": "str", # Optional. The upstream - version string for the version of Kubernetes provided by a given slug. - "slug": "str", # Optional. The slug identifier for an - available version of Kubernetes for use when creating or updating a - cluster. The string contains both the upstream version of Kubernetes as - well as the DigitalOcean revision. - "supported_features": [ - "str" # Optional. The features available with the - version of Kubernetes provided by a given slug. - ] - } - ] - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_kubernetes_get_available_upgrades_request( - cluster_id=cluster_id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -109595,9 +115878,9 @@ async def get_available_upgrades(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def upgrade_cluster( @@ -109608,6 +115891,7 @@ async def upgrade_cluster( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade a Kubernetes Cluster. To immediately upgrade a Kubernetes cluster to a newer patch release of @@ -109654,11 +115938,12 @@ async def upgrade_cluster( async def upgrade_cluster( self, cluster_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade a Kubernetes Cluster. To immediately upgrade a Kubernetes cluster to a newer patch release of @@ -109671,7 +115956,7 @@ async def upgrade_cluster( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -109697,8 +115982,9 @@ async def upgrade_cluster( @distributed_trace_async async def upgrade_cluster( - self, cluster_id: str, body: Union[JSON, IO], **kwargs: Any + self, cluster_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade a Kubernetes Cluster. To immediately upgrade a Kubernetes cluster to a newer patch release of @@ -109710,11 +115996,8 @@ async def upgrade_cluster( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -109722,6 +116005,12 @@ async def upgrade_cluster( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "version": "str" # Optional. The slug identifier for the version of + Kubernetes that the cluster will be upgraded to. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -109734,10 +116023,14 @@ async def upgrade_cluster( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109746,20 +116039,20 @@ async def upgrade_cluster( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_upgrade_cluster_request( + _request = build_kubernetes_upgrade_cluster_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -109767,18 +116060,21 @@ async def upgrade_cluster( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -109811,12 +116107,13 @@ async def upgrade_cluster( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_node_pools(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Node Pools in a Kubernetes Clusters. To list all of the node pools in a Kubernetes clusters, send a GET request to @@ -109916,10 +116213,14 @@ async def list_node_pools(self, cluster_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109928,25 +116229,28 @@ async def list_node_pools(self, cluster_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_list_node_pools_request( + _request = build_kubernetes_list_node_pools_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -109983,9 +116287,9 @@ async def list_node_pools(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def add_node_pool( @@ -109996,6 +116300,7 @@ async def add_node_pool( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a Node Pool to a Kubernetes Cluster. To add an additional node pool to a Kubernetes clusters, send a POST request @@ -110167,11 +116472,12 @@ async def add_node_pool( async def add_node_pool( self, cluster_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a Node Pool to a Kubernetes Cluster. To add an additional node pool to a Kubernetes clusters, send a POST request @@ -110181,7 +116487,7 @@ async def add_node_pool( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -110275,8 +116581,9 @@ async def add_node_pool( @distributed_trace_async async def add_node_pool( - self, cluster_id: str, body: Union[JSON, IO], **kwargs: Any + self, cluster_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a Node Pool to a Kubernetes Cluster. To add an additional node pool to a Kubernetes clusters, send a POST request @@ -110285,11 +116592,8 @@ async def add_node_pool( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -110297,6 +116601,72 @@ async def add_node_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "auto_scale": bool, # Optional. A boolean value indicating whether + auto-scaling is enabled for this node pool. + "count": 0, # Optional. The number of Droplet instances in the node pool. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a specific node pool. + "labels": {}, # Optional. An object of key/value mappings specifying labels + to apply to all nodes in a pool. Labels will automatically be applied to all + existing nodes and any subsequent nodes added to the pool. Note that when a label + is removed, it is not deleted from the nodes in the pool. + "max_nodes": 0, # Optional. The maximum number of nodes that this node pool + can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is set to + ``false``. + "min_nodes": 0, # Optional. The minimum number of nodes that this node pool + can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is set to + ``false``. + "name": "str", # Optional. A human-readable name for the node pool. + "nodes": [ + { + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the node was created. + "droplet_id": "str", # Optional. The ID of the Droplet used + for the worker node. + "id": "str", # Optional. A unique ID that can be used to + identify and reference the node. + "name": "str", # Optional. An automatically generated, + human-readable name for the node. + "status": { + "state": "str" # Optional. A string indicating the + current status of the node. Known values are: "provisioning", + "running", "draining", and "deleting". + }, + "updated_at": "2020-02-20 00:00:00" # Optional. A time value + given in ISO8601 combined date and time format that represents when the + node was last updated. + } + ], + "size": "str", # Optional. The slug identifier for the type of Droplet used + as workers in the node pool. + "tags": [ + "str" # Optional. An array containing the tags applied to the node + pool. All node pools are automatically tagged ``k8s``"" , ``k8s-worker``"" , + and ``k8s:$K8S_CLUSTER_ID``. + ], + "taints": [ + { + "effect": "str", # Optional. How the node reacts to pods + that it won't tolerate. Available effect values are ``NoSchedule``"" , + ``PreferNoSchedule``"" , and ``NoExecute``. Known values are: + "NoSchedule", "PreferNoSchedule", and "NoExecute". + "key": "str", # Optional. An arbitrary string. The ``key`` + and ``value`` fields of the ``taint`` object form a key-value pair. For + example, if the value of the ``key`` field is "special" and the value of + the ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + "value": "str" # Optional. An arbitrary string. The ``key`` + and ``value`` fields of the ``taint`` object form a key-value pair. For + example, if the value of the ``key`` field is "special" and the value of + the ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + } + ] + } + # response body for status code(s): 201 response == { "node_pool": { @@ -110377,10 +116747,14 @@ async def add_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -110389,20 +116763,20 @@ async def add_node_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_add_node_pool_request( + _request = build_kubernetes_add_node_pool_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -110410,18 +116784,21 @@ async def add_node_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -110458,14 +116835,15 @@ async def add_node_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_node_pool( self, cluster_id: str, node_pool_id: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve a Node Pool for a Kubernetes Cluster. To show information about a specific node pool in a Kubernetes cluster, send @@ -110563,10 +116941,14 @@ async def get_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -110575,26 +116957,29 @@ async def get_node_pool( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_node_pool_request( + _request = build_kubernetes_get_node_pool_request( cluster_id=cluster_id, node_pool_id=node_pool_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -110631,9 +117016,9 @@ async def get_node_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_node_pool( @@ -110645,6 +117030,7 @@ async def update_node_pool( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Node Pool in a Kubernetes Cluster. To update the name of a node pool, edit the tags applied to it, or adjust its @@ -110819,11 +117205,12 @@ async def update_node_pool( self, cluster_id: str, node_pool_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Node Pool in a Kubernetes Cluster. To update the name of a node pool, edit the tags applied to it, or adjust its @@ -110837,7 +117224,7 @@ async def update_node_pool( Required. :type node_pool_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -110931,8 +117318,13 @@ async def update_node_pool( @distributed_trace_async async def update_node_pool( - self, cluster_id: str, node_pool_id: str, body: Union[JSON, IO], **kwargs: Any + self, + cluster_id: str, + node_pool_id: str, + body: Union[JSON, IO[bytes]], + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Node Pool in a Kubernetes Cluster. To update the name of a node pool, edit the tags applied to it, or adjust its @@ -110945,11 +117337,8 @@ async def update_node_pool( :param node_pool_id: A unique ID that can be used to reference a Kubernetes node pool. Required. :type node_pool_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -110957,6 +117346,70 @@ async def update_node_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "auto_scale": bool, # Optional. A boolean value indicating whether + auto-scaling is enabled for this node pool. + "count": 0, # Optional. The number of Droplet instances in the node pool. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a specific node pool. + "labels": {}, # Optional. An object of key/value mappings specifying labels + to apply to all nodes in a pool. Labels will automatically be applied to all + existing nodes and any subsequent nodes added to the pool. Note that when a label + is removed, it is not deleted from the nodes in the pool. + "max_nodes": 0, # Optional. The maximum number of nodes that this node pool + can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is set to + ``false``. + "min_nodes": 0, # Optional. The minimum number of nodes that this node pool + can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is set to + ``false``. + "name": "str", # Optional. A human-readable name for the node pool. + "nodes": [ + { + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the node was created. + "droplet_id": "str", # Optional. The ID of the Droplet used + for the worker node. + "id": "str", # Optional. A unique ID that can be used to + identify and reference the node. + "name": "str", # Optional. An automatically generated, + human-readable name for the node. + "status": { + "state": "str" # Optional. A string indicating the + current status of the node. Known values are: "provisioning", + "running", "draining", and "deleting". + }, + "updated_at": "2020-02-20 00:00:00" # Optional. A time value + given in ISO8601 combined date and time format that represents when the + node was last updated. + } + ], + "tags": [ + "str" # Optional. An array containing the tags applied to the node + pool. All node pools are automatically tagged ``k8s``"" , ``k8s-worker``"" , + and ``k8s:$K8S_CLUSTER_ID``. + ], + "taints": [ + { + "effect": "str", # Optional. How the node reacts to pods + that it won't tolerate. Available effect values are ``NoSchedule``"" , + ``PreferNoSchedule``"" , and ``NoExecute``. Known values are: + "NoSchedule", "PreferNoSchedule", and "NoExecute". + "key": "str", # Optional. An arbitrary string. The ``key`` + and ``value`` fields of the ``taint`` object form a key-value pair. For + example, if the value of the ``key`` field is "special" and the value of + the ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + "value": "str" # Optional. An arbitrary string. The ``key`` + and ``value`` fields of the ``taint`` object form a key-value pair. For + example, if the value of the ``key`` field is "special" and the value of + the ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + } + ] + } + # response body for status code(s): 202 response == { "node_pool": { @@ -111037,10 +117490,14 @@ async def update_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111049,20 +117506,20 @@ async def update_node_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_update_node_pool_request( + _request = build_kubernetes_update_node_pool_request( cluster_id=cluster_id, node_pool_id=node_pool_id, content_type=content_type, @@ -111071,18 +117528,21 @@ async def update_node_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -111119,14 +117579,15 @@ async def update_node_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_node_pool( self, cluster_id: str, node_pool_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Node Pool in a Kubernetes Cluster. To delete a node pool, send a DELETE request to @@ -111159,10 +117620,14 @@ async def delete_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111171,26 +117636,29 @@ async def delete_node_pool( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_delete_node_pool_request( + _request = build_kubernetes_delete_node_pool_request( cluster_id=cluster_id, node_pool_id=node_pool_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -111223,9 +117691,9 @@ async def delete_node_pool( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def delete_node( @@ -111238,6 +117706,7 @@ async def delete_node( replace: int = 0, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Node in a Kubernetes Cluster. To delete a single node in a pool, send a DELETE request to @@ -111286,10 +117755,14 @@ async def delete_node( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111298,9 +117771,9 @@ async def delete_node( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_delete_node_request( + _request = build_kubernetes_delete_node_request( cluster_id=cluster_id, node_pool_id=node_pool_id, node_id=node_id, @@ -111309,18 +117782,21 @@ async def delete_node( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -111353,9 +117829,9 @@ async def delete_node( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def recycle_node_pool( @@ -111367,6 +117843,7 @@ async def recycle_node_pool( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Recycle a Kubernetes Node Pool. The endpoint has been deprecated. Please use the DELETE @@ -111415,11 +117892,12 @@ async def recycle_node_pool( self, cluster_id: str, node_pool_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Recycle a Kubernetes Node Pool. The endpoint has been deprecated. Please use the DELETE @@ -111432,7 +117910,7 @@ async def recycle_node_pool( Required. :type node_pool_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -111458,8 +117936,13 @@ async def recycle_node_pool( @distributed_trace_async async def recycle_node_pool( - self, cluster_id: str, node_pool_id: str, body: Union[JSON, IO], **kwargs: Any + self, + cluster_id: str, + node_pool_id: str, + body: Union[JSON, IO[bytes]], + **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Recycle a Kubernetes Node Pool. The endpoint has been deprecated. Please use the DELETE @@ -111471,11 +117954,8 @@ async def recycle_node_pool( :param node_pool_id: A unique ID that can be used to reference a Kubernetes node pool. Required. :type node_pool_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -111483,6 +117963,13 @@ async def recycle_node_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "nodes": [ + "str" # Optional. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -111495,10 +117982,14 @@ async def recycle_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111507,20 +117998,20 @@ async def recycle_node_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_recycle_node_pool_request( + _request = build_kubernetes_recycle_node_pool_request( cluster_id=cluster_id, node_pool_id=node_pool_id, content_type=content_type, @@ -111529,18 +118020,21 @@ async def recycle_node_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -111573,12 +118067,13 @@ async def recycle_node_pool( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_cluster_user(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve User Information for a Kubernetes Cluster. To show information the user associated with a Kubernetes cluster, send a GET @@ -111616,10 +118111,14 @@ async def get_cluster_user(self, cluster_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111628,25 +118127,28 @@ async def get_cluster_user(self, cluster_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_cluster_user_request( + _request = build_kubernetes_get_cluster_user_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -111683,12 +118185,13 @@ async def get_cluster_user(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_options(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Available Regions, Node Sizes, and Versions of Kubernetes. To list the versions of Kubernetes available for use, the regions that support Kubernetes, and @@ -111749,10 +118252,14 @@ async def list_options(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111761,24 +118268,27 @@ async def list_options(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_list_options_request( + _request = build_kubernetes_list_options_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -111815,9 +118325,9 @@ async def list_options(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def run_cluster_lint( @@ -111828,6 +118338,7 @@ async def run_cluster_lint( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Run Clusterlint Checks on a Kubernetes Cluster. Clusterlint helps operators conform to Kubernetes best practices around @@ -111899,11 +118410,12 @@ async def run_cluster_lint( async def run_cluster_lint( self, cluster_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Run Clusterlint Checks on a Kubernetes Cluster. Clusterlint helps operators conform to Kubernetes best practices around @@ -111922,7 +118434,7 @@ async def run_cluster_lint( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -111953,8 +118465,12 @@ async def run_cluster_lint( @distributed_trace_async async def run_cluster_lint( - self, cluster_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + cluster_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Run Clusterlint Checks on a Kubernetes Cluster. Clusterlint helps operators conform to Kubernetes best practices around @@ -111972,11 +118488,8 @@ async def run_cluster_lint( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -111984,6 +118497,26 @@ async def run_cluster_lint( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "exclude_checks": [ + "str" # Optional. An array of checks that will be run when + clusterlint executes checks. + ], + "exclude_groups": [ + "str" # Optional. An array of check groups that will be omitted when + clusterlint executes checks. + ], + "include_checks": [ + "str" # Optional. An array of checks that will be run when + clusterlint executes checks. + ], + "include_groups": [ + "str" # Optional. An array of check groups that will be run when + clusterlint executes checks. + ] + } + # response body for status code(s): 202 response == { "run_id": "str" # Optional. ID of the clusterlint run that can be used later @@ -112001,10 +118534,14 @@ async def run_cluster_lint( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112013,15 +118550,15 @@ async def run_cluster_lint( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -112029,7 +118566,7 @@ async def run_cluster_lint( else: _json = None - request = build_kubernetes_run_cluster_lint_request( + _request = build_kubernetes_run_cluster_lint_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -112037,18 +118574,21 @@ async def run_cluster_lint( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -112085,14 +118625,15 @@ async def run_cluster_lint( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_cluster_lint_results( self, cluster_id: str, *, run_id: Optional[str] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Fetch Clusterlint Diagnostics for a Kubernetes Cluster. To request clusterlint diagnostics for your cluster, send a GET request to @@ -112156,10 +118697,14 @@ async def get_cluster_lint_results( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112168,26 +118713,29 @@ async def get_cluster_lint_results( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_cluster_lint_results_request( + _request = build_kubernetes_get_cluster_lint_results_request( cluster_id=cluster_id, run_id=run_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -112224,9 +118772,9 @@ async def get_cluster_lint_results( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def add_registry( # pylint: disable=inconsistent-return-statements @@ -112265,7 +118813,7 @@ async def add_registry( # pylint: disable=inconsistent-return-statements @overload async def add_registry( # pylint: disable=inconsistent-return-statements self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -112276,7 +118824,7 @@ async def add_registry( # pylint: disable=inconsistent-return-statements ``/v2/kubernetes/registry``. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -112287,26 +118835,38 @@ async def add_registry( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def add_registry( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """Add Container Registry to Kubernetes Clusters. To integrate the container registry with Kubernetes clusters, send a POST request to ``/v2/kubernetes/registry``. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "cluster_uuids": [ + "str" # Optional. An array containing the UUIDs of Kubernetes + clusters. + ] + } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112315,15 +118875,15 @@ async def add_registry( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -112331,25 +118891,28 @@ async def add_registry( # pylint: disable=inconsistent-return-statements else: _json = None - request = build_kubernetes_add_registry_request( + _request = build_kubernetes_add_registry_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -112364,7 +118927,7 @@ async def add_registry( # pylint: disable=inconsistent-return-statements ) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) # type: ignore @overload async def remove_registry( # pylint: disable=inconsistent-return-statements @@ -112403,7 +118966,7 @@ async def remove_registry( # pylint: disable=inconsistent-return-statements @overload async def remove_registry( # pylint: disable=inconsistent-return-statements self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any @@ -112414,7 +118977,7 @@ async def remove_registry( # pylint: disable=inconsistent-return-statements ``/v2/kubernetes/registry``. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -112425,26 +118988,38 @@ async def remove_registry( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def remove_registry( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """Remove Container Registry from Kubernetes Clusters. To remove the container registry from Kubernetes clusters, send a DELETE request to ``/v2/kubernetes/registry``. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "cluster_uuids": [ + "str" # Optional. An array containing the UUIDs of Kubernetes + clusters. + ] + } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112453,15 +119028,15 @@ async def remove_registry( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -112469,25 +119044,28 @@ async def remove_registry( # pylint: disable=inconsistent-return-statements else: _json = None - request = build_kubernetes_remove_registry_request( + _request = build_kubernetes_remove_registry_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -112502,7 +119080,7 @@ async def remove_registry( # pylint: disable=inconsistent-return-statements ) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) # type: ignore class LoadBalancersOperations: @@ -112528,6 +119106,7 @@ def __init__(self, *args, **kwargs) -> None: async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Load Balancer. To create a new load balancer instance, send a POST request to @@ -112562,35 +119141,8 @@ async def create( # response body for status code(s): 202 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -112612,11 +119164,38 @@ async def create( balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -112659,8 +119238,8 @@ async def create( "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -112695,8 +119274,9 @@ async def create( @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Load Balancer. To create a new load balancer instance, send a POST request to @@ -112714,7 +119294,7 @@ async def create( These methods are mutually exclusive. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -112728,35 +119308,8 @@ async def create( # response body for status code(s): 202 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -112778,11 +119331,38 @@ async def create( balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -112825,8 +119405,8 @@ async def create( "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -112860,7 +119440,8 @@ async def create( """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Load Balancer. To create a new load balancer instance, send a POST request to @@ -112877,11 +119458,8 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: These methods are mutually exclusive. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -112889,38 +119467,14 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 202 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -112942,11 +119496,38 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -112989,8 +119570,8 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -113022,10 +119603,14 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -113034,38 +119619,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_create_request( + _request = build_load_balancers_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -113085,12 +119673,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Load Balancers. To list all of the load balancer instances on your account, send a GET request @@ -113109,43 +119698,16 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "links": { "pages": {} }, "load_balancers": [ { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify - an algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time - value given in ISO8601 combined date and time format that represents when - the load balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. - Default value is False. A boolean value indicating whether to disable - automatic DNS record creation for Let's Encrypt certificates that are - added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value - is False. A boolean value indicating whether HTTP keepalive connections - are maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is - False. A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing - traffic to the load balancer (in the form 'ip:1.2.3.4' or - 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying - traffic to the load balancer (in the form 'ip:1.2.3.4' or - 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID - of the TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. @@ -113170,11 +119732,41 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID + of the TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify + an algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the load balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. + Default value is False. A boolean value indicating whether to disable + automatic DNS record creation for Let's Encrypt certificates that are + added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value + is False. A boolean value indicating whether HTTP keepalive connections + are maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is + False. A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing + traffic to the load balancer (in the form 'ip:1.2.3.4' or + 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying + traffic to the load balancer (in the form 'ip:1.2.3.4' or + 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive @@ -113218,11 +119810,11 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now - equates to the load balancer having a set number of nodes."n"n"n* - ``lb-small`` = 1 node"n* ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 - nodes"n"nYou can resize load balancers after creation up to once per - hour. You cannot resize a load balancer within the first hour of its - creation. Known values are: "lb-small", "lb-medium", and "lb-large". + equates to the load balancer having a set number of nodes. * + ``lb-small`` = 1 node * ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes + You can resize load balancers after creation up to once per hour. You + cannot resize a load balancer within the first hour of its creation. + Known values are: "lb-small", "lb-medium", and "lb-large". "size_unit": 1, # Optional. Default value is 1. How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be @@ -113251,16 +119843,17 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the load balancer is assigned. } - ], - "meta": { - "total": 0 # Optional. Number of objects returned by the request. - } + ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -113269,26 +119862,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_load_balancers_list_request( + _request = build_load_balancers_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -113308,12 +119904,13 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, lb_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Load Balancer. To show information about a load balancer instance, send a GET request to @@ -113331,35 +119928,8 @@ async def get(self, lb_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -113381,11 +119951,38 @@ async def get(self, lb_id: str, **kwargs: Any) -> JSON: balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -113428,8 +120025,8 @@ async def get(self, lb_id: str, **kwargs: Any) -> JSON: "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -113472,10 +120069,14 @@ async def get(self, lb_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -113484,25 +120085,28 @@ async def get(self, lb_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_load_balancers_get_request( + _request = build_load_balancers_get_request( lb_id=lb_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -113539,9 +120143,9 @@ async def get(self, lb_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update( @@ -113552,6 +120156,7 @@ async def update( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Load Balancer. To update a load balancer's settings, send a PUT request to @@ -113581,35 +120186,8 @@ async def update( # response body for status code(s): 200 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -113631,11 +120209,38 @@ async def update( balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -113678,8 +120283,8 @@ async def update( "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -113727,11 +120332,12 @@ async def update( async def update( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Load Balancer. To update a load balancer's settings, send a PUT request to @@ -113744,7 +120350,7 @@ async def update( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -113758,35 +120364,8 @@ async def update( # response body for status code(s): 200 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -113808,11 +120387,38 @@ async def update( balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -113855,8 +120461,8 @@ async def update( "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -113901,7 +120507,10 @@ async def update( """ @distributed_trace_async - async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def update( + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Update a Load Balancer. To update a load balancer's settings, send a PUT request to @@ -113913,11 +120522,8 @@ async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -113925,9 +120531,42 @@ async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 200 response == { "load_balancer": { + "forwarding_rules": [ + { + "entry_port": 0, # An integer representing the port + on which the load balancer instance will listen. Required. + "entry_protocol": "str", # The protocol used for + traffic to the load balancer. The possible values are: ``http``"" , + ``https``"" , ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If + you set the ``entry_protocol`` to ``udp``"" , the + ``target_protocol`` must be set to ``udp``. When using UDP, the load + balancer requires that you set up a health check with a port that + uses TCP, HTTP, or HTTPS to work properly. Required. Known values + are: "http", "https", "http2", "http3", "tcp", and "udp". + "target_port": 0, # An integer representing the port + on the backend Droplets to which the load balancer will send traffic. + Required. + "target_protocol": "str", # The protocol used for + traffic from the load balancer to the backend Droplets. The possible + values are: ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or + ``udp``. If you set the ``target_protocol`` to ``udp``"" , the + ``entry_protocol`` must be set to ``udp``. When using UDP, the load + balancer requires that you set up a health check with a port that + uses TCP, HTTP, or HTTPS to work properly. Required. Known values + are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. + "tls_passthrough": bool # Optional. A boolean value + indicating whether SSL encrypted traffic will be passed through to + the backend Droplets. + } + ], "algorithm": "round_robin", # Optional. Default value is "round_robin". This field has been deprecated. You can no longer specify an algorithm for load balancers. Known values are: "round_robin" and @@ -113953,36 +120592,6 @@ async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). ] }, - "forwarding_rules": [ - { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. - "entry_port": 0, # An integer representing the port - on which the load balancer instance will listen. Required. - "entry_protocol": "str", # The protocol used for - traffic to the load balancer. The possible values are: ``http``"" , - ``https``"" , ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If - you set the ``entry_protocol`` to ``udp``"" , the - ``target_protocol`` must be set to ``udp``. When using UDP, the load - balancer requires that you set up a health check with a port that - uses TCP, HTTP, or HTTPS to work properly. Required. Known values - are: "http", "https", "http2", "http3", "tcp", and "udp". - "target_port": 0, # An integer representing the port - on the backend Droplets to which the load balancer will send traffic. - Required. - "target_protocol": "str", # The protocol used for - traffic from the load balancer to the backend Droplets. The possible - values are: ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or - ``udp``. If you set the ``target_protocol`` to ``udp``"" , the - ``entry_protocol`` must be set to ``udp``. When using UDP, the load - balancer requires that you set up a health check with a port that - uses TCP, HTTP, or HTTPS to work properly. Required. Known values - are: "http", "https", "http2", "tcp", and "udp". - "tls_passthrough": bool # Optional. A boolean value - indicating whether SSL encrypted traffic will be passed through to - the backend Droplets. - } - ], "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -114025,8 +120634,8 @@ async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -114069,10 +120678,14 @@ async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -114081,20 +120694,20 @@ async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_update_request( + _request = build_load_balancers_update_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -114102,18 +120715,21 @@ async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -114150,12 +120766,13 @@ async def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, lb_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Load Balancer. To delete a load balancer instance, disassociating any Droplets assigned to it @@ -114186,10 +120803,14 @@ async def delete(self, lb_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -114198,25 +120819,28 @@ async def delete(self, lb_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_load_balancers_delete_request( + _request = build_load_balancers_delete_request( lb_id=lb_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -114249,9 +120873,9 @@ async def delete(self, lb_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def add_droplets( @@ -114262,6 +120886,7 @@ async def add_droplets( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Load Balancer. To assign a Droplet to a load balancer instance, send a POST request to @@ -114314,11 +120939,12 @@ async def add_droplets( async def add_droplets( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Load Balancer. To assign a Droplet to a load balancer instance, send a POST request to @@ -114335,7 +120961,7 @@ async def add_droplets( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -114361,8 +120987,9 @@ async def add_droplets( @distributed_trace_async async def add_droplets( - self, lb_id: str, body: Union[JSON, IO], **kwargs: Any + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Load Balancer. To assign a Droplet to a load balancer instance, send a POST request to @@ -114378,11 +121005,8 @@ async def add_droplets( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -114390,6 +121014,14 @@ async def add_droplets( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "droplet_ids": [ + 0 # An array containing the IDs of the Droplets assigned to the load + balancer. Required. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -114402,10 +121034,14 @@ async def add_droplets( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -114414,20 +121050,20 @@ async def add_droplets( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_add_droplets_request( + _request = build_load_balancers_add_droplets_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -114435,18 +121071,21 @@ async def add_droplets( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -114479,9 +121118,9 @@ async def add_droplets( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def remove_droplets( @@ -114492,6 +121131,7 @@ async def remove_droplets( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Load Balancer. To remove a Droplet from a load balancer instance, send a DELETE request to @@ -114541,11 +121181,54 @@ async def remove_droplets( async def remove_droplets( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Remove Droplets from a Load Balancer. + + To remove a Droplet from a load balancer instance, send a DELETE request to + ``/v2/load_balancers/$LOAD_BALANCER_ID/droplets``. In the body of the request, + there should be a ``droplet_ids`` attribute containing a list of Droplet IDs. + + No response body will be sent back, but the response code will indicate + success. Specifically, the response code will be a 204, which means that the + action was successful with no returned body data. + + :param lb_id: A unique identifier for a load balancer. Required. + :type lb_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def remove_droplets( + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Load Balancer. To remove a Droplet from a load balancer instance, send a DELETE request to @@ -114556,10 +121239,231 @@ async def remove_droplets( success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. + :param lb_id: A unique identifier for a load balancer. Required. + :type lb_id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "droplet_ids": [ + 0 # An array containing the IDs of the Droplets assigned to the load + balancer. Required. + ] + } + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_load_balancers_remove_droplets_request( + lb_id=lb_id, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [204, 404]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + deserialized = None + response_headers = {} + if response.status_code == 204: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def add_forwarding_rules( + self, + lb_id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Add Forwarding Rules to a Load Balancer. + + To add an additional forwarding rule to a load balancer instance, send a POST + request to ``/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules``. In the body + of the request, there should be a ``forwarding_rules`` attribute containing an + array of rules to be added. + + No response body will be sent back, but the response code will indicate + success. Specifically, the response code will be a 204, which means that the + action was successful with no returned body data. + + :param lb_id: A unique identifier for a load balancer. Required. + :type lb_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "forwarding_rules": [ + { + "entry_port": 0, # An integer representing the port on which + the load balancer instance will listen. Required. + "entry_protocol": "str", # The protocol used for traffic to + the load balancer. The possible values are: ``http``"" , ``https``"" , + ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If you set the + ``entry_protocol`` to ``udp``"" , the ``target_protocol`` must be set to + ``udp``. When using UDP, the load balancer requires that you set up a + health check with a port that uses TCP, HTTP, or HTTPS to work properly. + Required. Known values are: "http", "https", "http2", "http3", "tcp", and + "udp". + "target_port": 0, # An integer representing the port on the + backend Droplets to which the load balancer will send traffic. Required. + "target_protocol": "str", # The protocol used for traffic + from the load balancer to the backend Droplets. The possible values are: + ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or ``udp``. If you + set the ``target_protocol`` to ``udp``"" , the ``entry_protocol`` must be + set to ``udp``. When using UDP, the load balancer requires that you set + up a health check with a port that uses TCP, HTTP, or HTTPS to work + properly. Required. Known values are: "http", "https", "http2", "tcp", + and "udp". + "certificate_id": "str", # Optional. The ID of the TLS + certificate used for SSL termination if enabled. + "tls_passthrough": bool # Optional. A boolean value + indicating whether SSL encrypted traffic will be passed through to the + backend Droplets. + } + ] + } + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def add_forwarding_rules( + self, + lb_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Add Forwarding Rules to a Load Balancer. + + To add an additional forwarding rule to a load balancer instance, send a POST + request to ``/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules``. In the body + of the request, there should be a ``forwarding_rules`` attribute containing an + array of rules to be added. + + No response body will be sent back, but the response code will indicate + success. Specifically, the response code will be a 204, which means that the + action was successful with no returned body data. + :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -114584,135 +121488,10 @@ async def remove_droplets( """ @distributed_trace_async - async def remove_droplets( - self, lb_id: str, body: Union[JSON, IO], **kwargs: Any - ) -> Optional[JSON]: - """Remove Droplets from a Load Balancer. - - To remove a Droplet from a load balancer instance, send a DELETE request to - ``/v2/load_balancers/$LOAD_BALANCER_ID/droplets``. In the body of the request, - there should be a ``droplet_ids`` attribute containing a list of Droplet IDs. - - No response body will be sent back, but the response code will indicate - success. Specifically, the response code will be a 204, which means that the - action was successful with no returned body data. - - :param lb_id: A unique identifier for a load balancer. Required. - :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_load_balancers_remove_droplets_request( - lb_id=lb_id, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - deserialized = None - response_headers = {} - if response.status_code == 204: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - @overload async def add_forwarding_rules( - self, - lb_id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Forwarding Rules to a Load Balancer. To add an additional forwarding rule to a load balancer instance, send a POST @@ -114726,11 +121505,8 @@ async def add_forwarding_rules( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -114742,8 +121518,6 @@ async def add_forwarding_rules( body = { "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the TLS - certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for traffic to @@ -114764,6 +121538,8 @@ async def add_forwarding_rules( up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the TLS + certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. @@ -114783,99 +121559,14 @@ async def add_forwarding_rules( tickets to help identify the issue. } """ - - @overload - async def add_forwarding_rules( - self, - lb_id: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[JSON]: - """Add Forwarding Rules to a Load Balancer. - - To add an additional forwarding rule to a load balancer instance, send a POST - request to ``/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules``. In the body - of the request, there should be a ``forwarding_rules`` attribute containing an - array of rules to be added. - - No response body will be sent back, but the response code will indicate - success. Specifically, the response code will be a 204, which means that the - action was successful with no returned body data. - - :param lb_id: A unique identifier for a load balancer. Required. - :type lb_id: str - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace_async - async def add_forwarding_rules( - self, lb_id: str, body: Union[JSON, IO], **kwargs: Any - ) -> Optional[JSON]: - """Add Forwarding Rules to a Load Balancer. - - To add an additional forwarding rule to a load balancer instance, send a POST - request to ``/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules``. In the body - of the request, there should be a ``forwarding_rules`` attribute containing an - array of rules to be added. - - No response body will be sent back, but the response code will indicate - success. Specifically, the response code will be a 204, which means that the - action was successful with no returned body data. - - :param lb_id: A unique identifier for a load balancer. Required. - :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -114884,20 +121575,20 @@ async def add_forwarding_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_add_forwarding_rules_request( + _request = build_load_balancers_add_forwarding_rules_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -114905,18 +121596,21 @@ async def add_forwarding_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -114949,9 +121643,9 @@ async def add_forwarding_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def remove_forwarding_rules( @@ -114962,6 +121656,7 @@ async def remove_forwarding_rules( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Forwarding Rules from a Load Balancer. To remove forwarding rules from a load balancer instance, send a DELETE @@ -114991,8 +121686,6 @@ async def remove_forwarding_rules( body = { "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the TLS - certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for traffic to @@ -115013,6 +121706,8 @@ async def remove_forwarding_rules( up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the TLS + certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. @@ -115037,11 +121732,12 @@ async def remove_forwarding_rules( async def remove_forwarding_rules( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Forwarding Rules from a Load Balancer. To remove forwarding rules from a load balancer instance, send a DELETE @@ -115056,7 +121752,7 @@ async def remove_forwarding_rules( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -115082,8 +121778,9 @@ async def remove_forwarding_rules( @distributed_trace_async async def remove_forwarding_rules( - self, lb_id: str, body: Union[JSON, IO], **kwargs: Any + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Forwarding Rules from a Load Balancer. To remove forwarding rules from a load balancer instance, send a DELETE @@ -115097,11 +121794,8 @@ async def remove_forwarding_rules( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -115109,6 +121803,39 @@ async def remove_forwarding_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "forwarding_rules": [ + { + "entry_port": 0, # An integer representing the port on which + the load balancer instance will listen. Required. + "entry_protocol": "str", # The protocol used for traffic to + the load balancer. The possible values are: ``http``"" , ``https``"" , + ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If you set the + ``entry_protocol`` to ``udp``"" , the ``target_protocol`` must be set to + ``udp``. When using UDP, the load balancer requires that you set up a + health check with a port that uses TCP, HTTP, or HTTPS to work properly. + Required. Known values are: "http", "https", "http2", "http3", "tcp", and + "udp". + "target_port": 0, # An integer representing the port on the + backend Droplets to which the load balancer will send traffic. Required. + "target_protocol": "str", # The protocol used for traffic + from the load balancer to the backend Droplets. The possible values are: + ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or ``udp``. If you + set the ``target_protocol`` to ``udp``"" , the ``entry_protocol`` must be + set to ``udp``. When using UDP, the load balancer requires that you set + up a health check with a port that uses TCP, HTTP, or HTTPS to work + properly. Required. Known values are: "http", "https", "http2", "tcp", + and "udp". + "certificate_id": "str", # Optional. The ID of the TLS + certificate used for SSL termination if enabled. + "tls_passthrough": bool # Optional. A boolean value + indicating whether SSL encrypted traffic will be passed through to the + backend Droplets. + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -115121,10 +121848,14 @@ async def remove_forwarding_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -115133,20 +121864,20 @@ async def remove_forwarding_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_remove_forwarding_rules_request( + _request = build_load_balancers_remove_forwarding_rules_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -115154,18 +121885,21 @@ async def remove_forwarding_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -115198,9 +121932,9 @@ async def remove_forwarding_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class MonitoringOperations: @@ -115226,6 +121960,7 @@ def __init__(self, *args, **kwargs) -> None: async def list_alert_policy( self, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Alert Policies. Returns all alert policies that are configured for the given account. To List all alert @@ -115244,9 +121979,6 @@ async def list_alert_policy( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, @@ -115308,13 +122040,20 @@ async def list_alert_policy( "window": "str" # Required. Known values are: "5m", "10m", "30m", and "1h". } - ] + ], + "links": { + "pages": {} + } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -115323,26 +122062,29 @@ async def list_alert_policy( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_list_alert_policy_request( + _request = build_monitoring_list_alert_policy_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -115362,14 +122104,15 @@ async def list_alert_policy( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_alert_policy( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Alert Policy. To create a new alert, send a POST request to ``/v2/monitoring/alerts``. @@ -115593,8 +122336,9 @@ async def create_alert_policy( @overload async def create_alert_policy( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Alert Policy. To create a new alert, send a POST request to ``/v2/monitoring/alerts``. @@ -115695,7 +122439,7 @@ async def create_alert_policy( * - ``v1/dbaas/alerts/cpu_alerts`` - alert on the percent CPU usage average across the database cluster - database cluster UUID. Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -115766,7 +122510,10 @@ async def create_alert_policy( """ @distributed_trace_async - async def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create_alert_policy( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Create Alert Policy. To create a new alert, send a POST request to ``/v2/monitoring/alerts``. @@ -115866,11 +122613,8 @@ async def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSO - database cluster UUID * - ``v1/dbaas/alerts/cpu_alerts`` - alert on the percent CPU usage average across the database cluster - - database cluster UUID. Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + - database cluster UUID. Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -115878,6 +122622,57 @@ async def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSO Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "alerts": { + "email": [ + "str" # An email to notify on an alert trigger. Required. + ], + "slack": [ + { + "channel": "str", # Slack channel to notify of an + alert trigger. Required. + "url": "str" # Slack Webhook URL. Required. + } + ] + }, + "compare": "str", # Required. Known values are: "GreaterThan" and + "LessThan". + "description": "str", # Required. + "enabled": bool, # Required. + "entities": [ + "str" # Required. + ], + "tags": [ + "str" # Required. + ], + "type": "str", # Required. Known values are: "v1/insights/droplet/load_1", + "v1/insights/droplet/load_5", "v1/insights/droplet/load_15", + "v1/insights/droplet/memory_utilization_percent", + "v1/insights/droplet/disk_utilization_percent", "v1/insights/droplet/cpu", + "v1/insights/droplet/disk_read", "v1/insights/droplet/disk_write", + "v1/insights/droplet/public_outbound_bandwidth", + "v1/insights/droplet/public_inbound_bandwidth", + "v1/insights/droplet/private_outbound_bandwidth", + "v1/insights/droplet/private_inbound_bandwidth", + "v1/insights/lbaas/avg_cpu_utilization_percent", + "v1/insights/lbaas/connection_utilization_percent", + "v1/insights/lbaas/droplet_health", + "v1/insights/lbaas/tls_connections_per_second_utilization_percent", + "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx", + "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx", + "v1/insights/lbaas/increase_in_http_error_rate_count_5xx", + "v1/insights/lbaas/increase_in_http_error_rate_count_4xx", + "v1/insights/lbaas/high_http_request_response_time", + "v1/insights/lbaas/high_http_request_response_time_50p", + "v1/insights/lbaas/high_http_request_response_time_95p", + "v1/insights/lbaas/high_http_request_response_time_99p", + "v1/dbaas/alerts/load_15_alerts", "v1/dbaas/alerts/memory_utilization_alerts", + "v1/dbaas/alerts/disk_utilization_alerts", and "v1/dbaas/alerts/cpu_alerts". + "value": 0.0, # Required. + "window": "str" # Required. Known values are: "5m", "10m", "30m", and "1h". + } + # response body for status code(s): 200 response == { "policy": { @@ -115936,10 +122731,14 @@ async def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSO } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -115948,38 +122747,41 @@ async def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSO _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_monitoring_create_alert_policy_request( + _request = build_monitoring_create_alert_policy_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -115999,12 +122801,13 @@ async def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_alert_policy(self, alert_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Alert Policy. To retrieve a given alert policy, send a GET request to ``/v2/monitoring/alerts/{alert_uuid}``. @@ -116087,10 +122890,14 @@ async def get_alert_policy(self, alert_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116099,25 +122906,28 @@ async def get_alert_policy(self, alert_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_alert_policy_request( + _request = build_monitoring_get_alert_policy_request( alert_uuid=alert_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -116154,9 +122964,9 @@ async def get_alert_policy(self, alert_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_alert_policy( @@ -116167,6 +122977,7 @@ async def update_alert_policy( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Alert Policy. To update en existing policy, send a PUT request to ``v2/monitoring/alerts/{alert_uuid}``. @@ -116405,11 +123216,12 @@ async def update_alert_policy( async def update_alert_policy( self, alert_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Alert Policy. To update en existing policy, send a PUT request to ``v2/monitoring/alerts/{alert_uuid}``. @@ -116512,7 +123324,7 @@ async def update_alert_policy( * - ``v1/dbaas/alerts/cpu_alerts`` - alert on the percent CPU usage average across the database cluster - database cluster UUID. Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -116595,8 +123407,9 @@ async def update_alert_policy( @distributed_trace_async async def update_alert_policy( - self, alert_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, alert_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Alert Policy. To update en existing policy, send a PUT request to ``v2/monitoring/alerts/{alert_uuid}``. @@ -116698,11 +123511,8 @@ async def update_alert_policy( - database cluster UUID * - ``v1/dbaas/alerts/cpu_alerts`` - alert on the percent CPU usage average across the database cluster - - database cluster UUID. Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + - database cluster UUID. Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -116710,6 +123520,57 @@ async def update_alert_policy( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "alerts": { + "email": [ + "str" # An email to notify on an alert trigger. Required. + ], + "slack": [ + { + "channel": "str", # Slack channel to notify of an + alert trigger. Required. + "url": "str" # Slack Webhook URL. Required. + } + ] + }, + "compare": "str", # Required. Known values are: "GreaterThan" and + "LessThan". + "description": "str", # Required. + "enabled": bool, # Required. + "entities": [ + "str" # Required. + ], + "tags": [ + "str" # Required. + ], + "type": "str", # Required. Known values are: "v1/insights/droplet/load_1", + "v1/insights/droplet/load_5", "v1/insights/droplet/load_15", + "v1/insights/droplet/memory_utilization_percent", + "v1/insights/droplet/disk_utilization_percent", "v1/insights/droplet/cpu", + "v1/insights/droplet/disk_read", "v1/insights/droplet/disk_write", + "v1/insights/droplet/public_outbound_bandwidth", + "v1/insights/droplet/public_inbound_bandwidth", + "v1/insights/droplet/private_outbound_bandwidth", + "v1/insights/droplet/private_inbound_bandwidth", + "v1/insights/lbaas/avg_cpu_utilization_percent", + "v1/insights/lbaas/connection_utilization_percent", + "v1/insights/lbaas/droplet_health", + "v1/insights/lbaas/tls_connections_per_second_utilization_percent", + "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx", + "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx", + "v1/insights/lbaas/increase_in_http_error_rate_count_5xx", + "v1/insights/lbaas/increase_in_http_error_rate_count_4xx", + "v1/insights/lbaas/high_http_request_response_time", + "v1/insights/lbaas/high_http_request_response_time_50p", + "v1/insights/lbaas/high_http_request_response_time_95p", + "v1/insights/lbaas/high_http_request_response_time_99p", + "v1/dbaas/alerts/load_15_alerts", "v1/dbaas/alerts/memory_utilization_alerts", + "v1/dbaas/alerts/disk_utilization_alerts", and "v1/dbaas/alerts/cpu_alerts". + "value": 0.0, # Required. + "window": "str" # Required. Known values are: "5m", "10m", "30m", and "1h". + } + # response body for status code(s): 200 response == { "policy": { @@ -116779,10 +123640,14 @@ async def update_alert_policy( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116791,20 +123656,20 @@ async def update_alert_policy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_monitoring_update_alert_policy_request( + _request = build_monitoring_update_alert_policy_request( alert_uuid=alert_uuid, content_type=content_type, json=_json, @@ -116812,18 +123677,21 @@ async def update_alert_policy( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -116860,14 +123728,15 @@ async def update_alert_policy( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_alert_policy( self, alert_uuid: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Alert Policy. To delete an alert policy, send a DELETE request to ``/v2/monitoring/alerts/{alert_uuid}``. @@ -116893,10 +123762,14 @@ async def delete_alert_policy( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116905,25 +123778,28 @@ async def delete_alert_policy( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_monitoring_delete_alert_policy_request( + _request = build_monitoring_delete_alert_policy_request( alert_uuid=alert_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -116956,9 +123832,9 @@ async def delete_alert_policy( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_droplet_bandwidth_metrics( @@ -117018,10 +123894,14 @@ async def get_droplet_bandwidth_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117030,9 +123910,9 @@ async def get_droplet_bandwidth_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_bandwidth_metrics_request( + _request = build_monitoring_get_droplet_bandwidth_metrics_request( host_id=host_id, interface=interface, direction=direction, @@ -117041,18 +123921,21 @@ async def get_droplet_bandwidth_metrics( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117072,9 +123955,9 @@ async def get_droplet_bandwidth_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_cpu_metrics( @@ -117119,10 +124002,14 @@ async def get_droplet_cpu_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117131,27 +124018,30 @@ async def get_droplet_cpu_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_cpu_metrics_request( + _request = build_monitoring_get_droplet_cpu_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117171,9 +124061,9 @@ async def get_droplet_cpu_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_filesystem_free_metrics( @@ -117218,10 +124108,14 @@ async def get_droplet_filesystem_free_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117230,27 +124124,30 @@ async def get_droplet_filesystem_free_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_filesystem_free_metrics_request( + _request = build_monitoring_get_droplet_filesystem_free_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117270,9 +124167,9 @@ async def get_droplet_filesystem_free_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_filesystem_size_metrics( @@ -117317,10 +124214,14 @@ async def get_droplet_filesystem_size_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117329,27 +124230,30 @@ async def get_droplet_filesystem_size_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_filesystem_size_metrics_request( + _request = build_monitoring_get_droplet_filesystem_size_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117369,9 +124273,9 @@ async def get_droplet_filesystem_size_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_load1_metrics( @@ -117416,10 +124320,14 @@ async def get_droplet_load1_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117428,27 +124336,30 @@ async def get_droplet_load1_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_load1_metrics_request( + _request = build_monitoring_get_droplet_load1_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117468,9 +124379,9 @@ async def get_droplet_load1_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_load5_metrics( @@ -117515,10 +124426,14 @@ async def get_droplet_load5_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117527,27 +124442,30 @@ async def get_droplet_load5_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_load5_metrics_request( + _request = build_monitoring_get_droplet_load5_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117567,9 +124485,9 @@ async def get_droplet_load5_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_load15_metrics( @@ -117614,10 +124532,14 @@ async def get_droplet_load15_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117626,27 +124548,30 @@ async def get_droplet_load15_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_load15_metrics_request( + _request = build_monitoring_get_droplet_load15_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117666,9 +124591,9 @@ async def get_droplet_load15_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_memory_cached_metrics( @@ -117713,10 +124638,14 @@ async def get_droplet_memory_cached_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117725,27 +124654,30 @@ async def get_droplet_memory_cached_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_memory_cached_metrics_request( + _request = build_monitoring_get_droplet_memory_cached_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117765,9 +124697,9 @@ async def get_droplet_memory_cached_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_memory_free_metrics( @@ -117812,10 +124744,14 @@ async def get_droplet_memory_free_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117824,27 +124760,30 @@ async def get_droplet_memory_free_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_memory_free_metrics_request( + _request = build_monitoring_get_droplet_memory_free_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117864,9 +124803,9 @@ async def get_droplet_memory_free_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_memory_total_metrics( @@ -117911,10 +124850,14 @@ async def get_droplet_memory_total_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117923,27 +124866,30 @@ async def get_droplet_memory_total_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_memory_total_metrics_request( + _request = build_monitoring_get_droplet_memory_total_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117963,9 +124909,9 @@ async def get_droplet_memory_total_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_droplet_memory_available_metrics( @@ -118010,10 +124956,14 @@ async def get_droplet_memory_available_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118022,27 +124972,30 @@ async def get_droplet_memory_available_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_memory_available_metrics_request( + _request = build_monitoring_get_droplet_memory_available_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118062,9 +125015,9 @@ async def get_droplet_memory_available_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_app_memory_percentage_metrics( @@ -118117,10 +125070,14 @@ async def get_app_memory_percentage_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118129,9 +125086,9 @@ async def get_app_memory_percentage_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_app_memory_percentage_metrics_request( + _request = build_monitoring_get_app_memory_percentage_metrics_request( app_id=app_id, start=start, end=end, @@ -118139,18 +125096,21 @@ async def get_app_memory_percentage_metrics( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118170,9 +125130,9 @@ async def get_app_memory_percentage_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_app_cpu_percentage_metrics( @@ -118225,10 +125185,14 @@ async def get_app_cpu_percentage_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118237,9 +125201,9 @@ async def get_app_cpu_percentage_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_app_cpu_percentage_metrics_request( + _request = build_monitoring_get_app_cpu_percentage_metrics_request( app_id=app_id, start=start, end=end, @@ -118247,18 +125211,21 @@ async def get_app_cpu_percentage_metrics( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118278,9 +125245,9 @@ async def get_app_cpu_percentage_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_app_restart_count_metrics_yml( @@ -118333,10 +125300,14 @@ async def get_app_restart_count_metrics_yml( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118345,9 +125316,9 @@ async def get_app_restart_count_metrics_yml( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_app_restart_count_metrics_yml_request( + _request = build_monitoring_get_app_restart_count_metrics_yml_request( app_id=app_id, start=start, end=end, @@ -118355,18 +125326,21 @@ async def get_app_restart_count_metrics_yml( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118386,9 +125360,9 @@ async def get_app_restart_count_metrics_yml( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class ProjectsOperations: @@ -118412,6 +125386,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Projects. To list all your projects, send a GET request to ``/v2/projects``. @@ -118429,12 +125404,12 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "projects": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -118457,13 +125432,13 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. - The maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / - Educational purposes"n* Website or blog"n* Web Application"n* Service or - API"n* Mobile Application"n* Machine learning / AI / Data processing"n* - IoT"n* Operational / Developer tooling"n"nIf another value for purpose is - specified, for example, "your custom purpose","nyour purpose will be - stored as ``Other: your custom purpose``. + The maximum length is 255 characters. It can have one of the following + values: * Just trying out DigitalOcean * Class project / Educational + purposes * Website or blog * Web Application * Service or API * Mobile + Application * Machine learning / AI / Data processing * IoT * Operational + / Developer tooling If another value for purpose is specified, for + example, "your custom purpose", your purpose will be stored as ``Other: + your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -118471,10 +125446,14 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118483,26 +125462,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_list_request( + _request = build_projects_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118522,14 +125504,15 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Project. To create a project, send a POST request to ``/v2/projects``. @@ -118562,12 +125545,12 @@ async def create( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -118593,13 +125576,12 @@ async def create( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -118609,14 +125591,15 @@ async def create( @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Project. To create a project, send a POST request to ``/v2/projects``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -118647,13 +125630,12 @@ async def create( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -118662,16 +125644,14 @@ async def create( """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a Project. To create a project, send a POST request to ``/v2/projects``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -118679,6 +125659,33 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. + } + # response body for status code(s): 201 response == { "project": { @@ -118699,23 +125706,26 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118724,38 +125734,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_create_request( + _request = build_projects_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118775,12 +125788,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_default(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve the Default Project. To get your default project, send a GET request to ``/v2/projects/default``. @@ -118812,13 +125826,12 @@ async def get_default(self, **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -118836,10 +125849,14 @@ async def get_default(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118848,24 +125865,27 @@ async def get_default(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_get_default_request( + _request = build_projects_get_default_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118902,14 +125922,15 @@ async def get_default(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update the Default Project. To update you default project, send a PUT request to ``/v2/projects/default``. All of the @@ -118945,12 +125966,12 @@ async def update_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -118976,13 +125997,12 @@ async def update_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119003,15 +126023,16 @@ async def update_default( @overload async def update_default( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update the Default Project. To update you default project, send a PUT request to ``/v2/projects/default``. All of the following attributes must be sent. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -119042,13 +126063,12 @@ async def update_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119068,17 +126088,15 @@ async def update_default( """ @distributed_trace_async - async def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def update_default(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Update the Default Project. To update you default project, send a PUT request to ``/v2/projects/default``. All of the following attributes must be sent. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -119086,6 +126104,35 @@ async def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "is_default": bool, # Optional. If true, all resources will be added to this + project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. + } + # response body for status code(s): 200 response == { "project": { @@ -119106,13 +126153,12 @@ async def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119130,10 +126176,14 @@ async def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -119142,38 +126192,41 @@ async def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_update_default_request( + _request = build_projects_update_default_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -119210,14 +126263,15 @@ async def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def patch_default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Patch the Default Project. To update only specific attributes of your default project, send a PATCH request to @@ -119253,12 +126307,12 @@ async def patch_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119284,13 +126338,78 @@ async def patch_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given + in ISO8601 combined date and time format that represents when the project was + updated. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def patch_default( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Patch the Default Project. + + To update only specific attributes of your default project, send a PATCH request to + ``/v2/projects/default``. At least one of the following attributes needs to be sent. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "project": { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. + The maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this + project. + "is_default": bool, # Optional. If true, all resources will be added + to this project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. + The maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of + the project owner. + "purpose": "str", # Optional. The purpose of the project. The + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119309,20 +126428,16 @@ async def patch_default( } """ - @overload - async def patch_default( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: + @distributed_trace_async + async def patch_default(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Patch the Default Project. To update only specific attributes of your default project, send a PATCH request to ``/v2/projects/default``. At least one of the following attributes needs to be sent. - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -119330,69 +126445,34 @@ async def patch_default( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "project": { - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the project was - created. - "description": "str", # Optional. The description of the project. - The maximum length is 255 characters. - "environment": "str", # Optional. The environment of the project's - resources. Known values are: "Development", "Staging", and "Production". - "id": "str", # Optional. The unique universal identifier of this - project. - "is_default": bool, # Optional. If true, all resources will be added - to this project if no project is specified. - "name": "str", # Optional. The human-readable name for the project. - The maximum length is 175 characters and the name must be unique. - "owner_id": 0, # Optional. The integer id of the project owner. - "owner_uuid": "str", # Optional. The unique universal identifier of - the project owner. - "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. - "updated_at": "2020-02-20 00:00:00" # Optional. A time value given - in ISO8601 combined date and time format that represents when the project was - updated. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "is_default": bool, # Optional. If true, all resources will be added to this + project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. } - """ - - @distributed_trace_async - async def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Patch the Default Project. - - To update only specific attributes of your default project, send a PATCH request to - ``/v2/projects/default``. At least one of the following attributes needs to be sent. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { @@ -119414,13 +126494,12 @@ async def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119438,10 +126517,14 @@ async def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -119450,38 +126533,41 @@ async def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_patch_default_request( + _request = build_projects_patch_default_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -119518,12 +126604,13 @@ async def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, project_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Project. To get a project, send a GET request to ``/v2/projects/$PROJECT_ID``. @@ -119557,13 +126644,12 @@ async def get(self, project_id: str, **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119581,10 +126667,14 @@ async def get(self, project_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -119593,25 +126683,28 @@ async def get(self, project_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_get_request( + _request = build_projects_get_request( project_id=project_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -119648,9 +126741,9 @@ async def get(self, project_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update( @@ -119661,6 +126754,7 @@ async def update( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Project. To update a project, send a PUT request to ``/v2/projects/$PROJECT_ID``. All of the following @@ -119698,12 +126792,12 @@ async def update( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119729,13 +126823,12 @@ async def update( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119758,11 +126851,12 @@ async def update( async def update( self, project_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Project. To update a project, send a PUT request to ``/v2/projects/$PROJECT_ID``. All of the following @@ -119771,7 +126865,7 @@ async def update( :param project_id: A unique identifier for a project. Required. :type project_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -119802,13 +126896,12 @@ async def update( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119829,8 +126922,9 @@ async def update( @distributed_trace_async async def update( - self, project_id: str, body: Union[JSON, IO], **kwargs: Any + self, project_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Project. To update a project, send a PUT request to ``/v2/projects/$PROJECT_ID``. All of the following @@ -119838,11 +126932,8 @@ async def update( :param project_id: A unique identifier for a project. Required. :type project_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -119850,6 +126941,35 @@ async def update( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "is_default": bool, # Optional. If true, all resources will be added to this + project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. + } + # response body for status code(s): 200 response == { "project": { @@ -119870,13 +126990,12 @@ async def update( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -119894,10 +127013,14 @@ async def update( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -119906,20 +127029,20 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_update_request( + _request = build_projects_update_request( project_id=project_id, content_type=content_type, json=_json, @@ -119927,18 +127050,21 @@ async def update( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -119975,9 +127101,9 @@ async def update( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def patch( @@ -119988,6 +127114,7 @@ async def patch( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Patch a Project. To update only specific attributes of a project, send a PATCH request to @@ -120025,12 +127152,12 @@ async def patch( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -120056,13 +127183,12 @@ async def patch( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -120085,11 +127211,12 @@ async def patch( async def patch( self, project_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Patch a Project. To update only specific attributes of a project, send a PATCH request to @@ -120098,7 +127225,7 @@ async def patch( :param project_id: A unique identifier for a project. Required. :type project_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -120129,13 +127256,12 @@ async def patch( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -120156,8 +127282,9 @@ async def patch( @distributed_trace_async async def patch( - self, project_id: str, body: Union[JSON, IO], **kwargs: Any + self, project_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Patch a Project. To update only specific attributes of a project, send a PATCH request to @@ -120165,11 +127292,8 @@ async def patch( :param project_id: A unique identifier for a project. Required. :type project_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -120177,6 +127301,35 @@ async def patch( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "is_default": bool, # Optional. If true, all resources will be added to this + project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. + } + # response body for status code(s): 200 response == { "project": { @@ -120197,13 +127350,12 @@ async def patch( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -120221,10 +127373,14 @@ async def patch( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -120233,20 +127389,20 @@ async def patch( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_patch_request( + _request = build_projects_patch_request( project_id=project_id, content_type=content_type, json=_json, @@ -120254,18 +127410,21 @@ async def patch( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -120302,12 +127461,13 @@ async def patch( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, project_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Existing Project. To delete a project, send a DELETE request to ``/v2/projects/$PROJECT_ID``. To @@ -120338,10 +127498,14 @@ async def delete(self, project_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -120350,25 +127514,28 @@ async def delete(self, project_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_projects_delete_request( + _request = build_projects_delete_request( project_id=project_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404, 412]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -120417,14 +127584,15 @@ async def delete(self, project_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_resources( self, project_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Project Resources. To list all your resources in a project, send a GET request to @@ -120445,12 +127613,12 @@ async def list_resources( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "resources": [ { "assigned_at": "2020-02-20 00:00:00", # Optional. A time @@ -120480,10 +127648,14 @@ async def list_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -120492,27 +127664,30 @@ async def list_resources( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_list_resources_request( + _request = build_projects_list_resources_request( project_id=project_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -120549,9 +127724,9 @@ async def list_resources( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def assign_resources( @@ -120562,6 +127737,7 @@ async def assign_resources( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to a Project. To assign resources to a project, send a POST request to @@ -120625,11 +127801,12 @@ async def assign_resources( async def assign_resources( self, project_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to a Project. To assign resources to a project, send a POST request to @@ -120638,7 +127815,7 @@ async def assign_resources( :param project_id: A unique identifier for a project. Required. :type project_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -120683,8 +127860,9 @@ async def assign_resources( @distributed_trace_async async def assign_resources( - self, project_id: str, body: Union[JSON, IO], **kwargs: Any + self, project_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to a Project. To assign resources to a project, send a POST request to @@ -120692,11 +127870,8 @@ async def assign_resources( :param project_id: A unique identifier for a project. Required. :type project_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -120704,6 +127879,14 @@ async def assign_resources( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "resources": [ + "str" # Optional. A list of uniform resource names (URNs) to be + added to a project. + ] + } + # response body for status code(s): 200 response == { "resources": [ @@ -120735,10 +127918,14 @@ async def assign_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -120747,20 +127934,20 @@ async def assign_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_assign_resources_request( + _request = build_projects_assign_resources_request( project_id=project_id, content_type=content_type, json=_json, @@ -120768,18 +127955,21 @@ async def assign_resources( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -120816,12 +128006,13 @@ async def assign_resources( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_resources_default(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Default Project Resources. To list all your resources in your default project, send a GET request to @@ -120836,12 +128027,12 @@ async def list_resources_default(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "resources": [ { "assigned_at": "2020-02-20 00:00:00", # Optional. A time @@ -120871,10 +128062,14 @@ async def list_resources_default(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -120883,24 +128078,27 @@ async def list_resources_default(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_list_resources_default_request( + _request = build_projects_list_resources_default_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -120937,14 +128135,15 @@ async def list_resources_default(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def assign_resources_default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to Default Project. To assign resources to your default project, send a POST request to @@ -121004,15 +128203,16 @@ async def assign_resources_default( @overload async def assign_resources_default( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to Default Project. To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -121057,18 +128257,16 @@ async def assign_resources_default( @distributed_trace_async async def assign_resources_default( - self, body: Union[JSON, IO], **kwargs: Any + self, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to Default Project. To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -121076,6 +128274,14 @@ async def assign_resources_default( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "resources": [ + "str" # Optional. A list of uniform resource names (URNs) to be + added to a project. + ] + } + # response body for status code(s): 200 response == { "resources": [ @@ -121107,10 +128313,14 @@ async def assign_resources_default( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121119,38 +128329,41 @@ async def assign_resources_default( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_assign_resources_default_request( + _request = build_projects_assign_resources_default_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -121187,9 +128400,9 @@ async def assign_resources_default( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class RegionsOperations: @@ -121213,6 +128426,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Data Center Regions. To list all of the regions that are available, send a GET request to ``/v2/regions``. @@ -121232,9 +128446,6 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, @@ -121253,13 +128464,20 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO "slug": "str" # A human-readable string that is used as a unique identifier for each region. Required. } - ] + ], + "links": { + "pages": {} + } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121268,26 +128486,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_regions_list_request( + _request = build_regions_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -121307,9 +128528,9 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class RegistryOperations: @@ -121333,6 +128554,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Container Registry Information. To get information about your container registry, send a GET request to ``/v2/registry``. @@ -121392,10 +128614,14 @@ async def get(self, **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121404,24 +128630,27 @@ async def get(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_request( + _request = build_registry_get_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -121441,20 +128670,21 @@ async def get(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Container Registry. To create your container registry, send a POST request to ``/v2/registry``. The ``name`` becomes part of the URL for images stored in the registry. For - example, if your registry is called ``example``\ , an image in it will have the + example, if your registry is called ``example``\\ , an image in it will have the URL ``registry.digitalocean.com/example/image:tag``. :param body: Required. @@ -121474,12 +128704,12 @@ async def create( "name": "str", # A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and ``-``"" , up to a limit of 63 characters. Required. - "region": "str", # Optional. Slug of the region where registry data is - stored. When not provided, a region will be selected. Known values are: "nyc3", - "sfo3", "ams3", "sgp1", and "fra1". - "subscription_tier_slug": "str" # The slug of the subscription tier to sign + "subscription_tier_slug": "str", # The slug of the subscription tier to sign up for. Valid values can be retrieved using the options endpoint. Required. Known values are: "starter", "basic", and "professional". + "region": "str" # Optional. Slug of the region where registry data is + stored. When not provided, a region will be selected. Known values are: "nyc3", + "sfo3", "ams3", "sgp1", and "fra1". } # response body for status code(s): 201 @@ -121533,18 +128763,19 @@ async def create( @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Container Registry. To create your container registry, send a POST request to ``/v2/registry``. The ``name`` becomes part of the URL for images stored in the registry. For - example, if your registry is called ``example``\ , an image in it will have the + example, if your registry is called ``example``\\ , an image in it will have the URL ``registry.digitalocean.com/example/image:tag``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -121605,20 +128836,18 @@ async def create( """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create Container Registry. To create your container registry, send a POST request to ``/v2/registry``. The ``name`` becomes part of the URL for images stored in the registry. For - example, if your registry is called ``example``\ , an image in it will have the + example, if your registry is called ``example``\\ , an image in it will have the URL ``registry.digitalocean.com/example/image:tag``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -121626,6 +128855,19 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A globally unique name for the container registry. Must be + lowercase and be composed only of numbers, letters and ``-``"" , up to a limit of + 63 characters. Required. + "subscription_tier_slug": "str", # The slug of the subscription tier to sign + up for. Valid values can be retrieved using the options endpoint. Required. Known + values are: "starter", "basic", and "professional". + "region": "str" # Optional. Slug of the region where registry data is + stored. When not provided, a region will be selected. Known values are: "nyc3", + "sfo3", "ams3", "sgp1", and "fra1". + } + # response body for status code(s): 201 response == { "registry": { @@ -121674,10 +128916,14 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121686,38 +128932,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_registry_create_request( + _request = build_registry_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -121737,12 +128986,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Container Registry. To delete your container registry, destroying all container image data stored in it, send a @@ -121767,10 +129017,14 @@ async def delete(self, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121779,24 +129033,27 @@ async def delete(self, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_registry_delete_request( + _request = build_registry_delete_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -121829,12 +129086,13 @@ async def delete(self, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_subscription(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Subscription Information. A subscription is automatically created when you configure your container registry. To get @@ -121879,10 +129137,14 @@ async def get_subscription(self, **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121891,24 +129153,27 @@ async def get_subscription(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_subscription_request( + _request = build_registry_get_subscription_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -121928,9 +129193,9 @@ async def get_subscription(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_subscription( @@ -121940,6 +129205,7 @@ async def update_subscription( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Subscription Tier. After creating your registry, you can switch to a different subscription tier to better suit @@ -121999,18 +129265,19 @@ async def update_subscription( @overload async def update_subscription( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Subscription Tier. After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to ``/v2/registry/subscription``. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -122056,18 +129323,16 @@ async def update_subscription( @distributed_trace_async async def update_subscription( - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Subscription Tier. After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to ``/v2/registry/subscription``. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -122075,6 +129340,12 @@ async def update_subscription( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "tier_slug": "str" # Optional. The slug of the subscription tier to sign up + for. Known values are: "starter", "basic", and "professional". + } + # response body for status code(s): 200 response == { "subscription": { @@ -122107,10 +129378,14 @@ async def update_subscription( } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122119,15 +129394,15 @@ async def update_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -122135,25 +129410,28 @@ async def update_subscription( else: _json = None - request = build_registry_update_subscription_request( + _request = build_registry_update_subscription_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -122173,9 +129451,9 @@ async def update_subscription( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_docker_credentials( @@ -122193,8 +129471,8 @@ async def get_docker_credentials( .. code-block:: - kubectl create secret generic docr \ - --from-file=.dockerconfigjson=config.json \ + kubectl create secret generic docr \\ + --from-file=.dockerconfigjson=config.json \\ --type=kubernetes.io/dockerconfigjson @@ -122232,10 +129510,14 @@ async def get_docker_credentials( } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122244,26 +129526,29 @@ async def get_docker_credentials( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_docker_credentials_request( + _request = build_registry_get_docker_credentials_request( expiry_seconds=expiry_seconds, read_write=read_write, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -122283,14 +129568,15 @@ async def get_docker_credentials( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def validate_name( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Validate a Container Registry Name. To validate that a container registry name is available for use, send a POST @@ -122334,8 +129620,9 @@ async def validate_name( @overload async def validate_name( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Validate a Container Registry Name. To validate that a container registry name is available for use, send a POST @@ -122346,7 +129633,7 @@ async def validate_name( be a 409 Conflict. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -122372,8 +129659,9 @@ async def validate_name( @distributed_trace_async async def validate_name( - self, body: Union[JSON, IO], **kwargs: Any + self, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Validate a Container Registry Name. To validate that a container registry name is available for use, send a POST @@ -122383,11 +129671,8 @@ async def validate_name( be 204 and contain no body. If the name is already in use, the response will be a 409 Conflict. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -122395,6 +129680,13 @@ async def validate_name( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # A globally unique name for the container registry. Must be + lowercase and be composed only of numbers, letters and ``-``"" , up to a limit of + 63 characters. Required. + } + # response body for status code(s): 409 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -122407,10 +129699,14 @@ async def validate_name( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122419,38 +129715,41 @@ async def validate_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_registry_validate_name_request( + _request = build_registry_validate_name_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 409]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -122483,14 +129782,15 @@ async def validate_name( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_repositories( self, registry_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Container Registry Repositories. This endpoint has been deprecated in favor of the *List All Container Registry Repositories @@ -122514,12 +129814,12 @@ async def list_repositories( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "repositories": [ { "latest_tag": { @@ -122558,10 +129858,14 @@ async def list_repositories( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122570,27 +129874,30 @@ async def list_repositories( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_repositories_request( + _request = build_registry_list_repositories_request( registry_name=registry_name, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -122627,9 +129934,9 @@ async def list_repositories( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_repositories_v2( @@ -122641,6 +129948,7 @@ async def list_repositories_v2( page_token: Optional[str] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Container Registry Repositories (V2). To list all repositories in your container registry, send a GET request to @@ -122665,12 +129973,12 @@ async def list_repositories_v2( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "repositories": [ { "latest_manifest": { @@ -122721,10 +130029,14 @@ async def list_repositories_v2( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122733,9 +130045,9 @@ async def list_repositories_v2( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_repositories_v2_request( + _request = build_registry_list_repositories_v2_request( registry_name=registry_name, per_page=per_page, page=page, @@ -122743,18 +130055,21 @@ async def list_repositories_v2( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -122807,9 +130122,9 @@ async def list_repositories_v2( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_repository_tags( @@ -122821,6 +130136,7 @@ async def list_repository_tags( page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Container Registry Repository Tags. To list all tags in your container registry repository, send a GET @@ -122828,7 +130144,7 @@ async def list_repository_tags( Note that if your repository name contains ``/`` characters, it must be URL-encoded in the request URL. For example, to list tags for - ``registry.digitalocean.com/example/my/repo``\ , the path would be + ``registry.digitalocean.com/example/my/repo``\\ , the path would be ``/v2/registry/example/repositories/my%2Frepo/tags``. :param registry_name: The name of a container registry. Required. @@ -122849,12 +130165,12 @@ async def list_repository_tags( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "tags": [ { "compressed_size_bytes": 0, # Optional. The compressed size @@ -122885,10 +130201,14 @@ async def list_repository_tags( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122897,9 +130217,9 @@ async def list_repository_tags( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_repository_tags_request( + _request = build_registry_list_repository_tags_request( registry_name=registry_name, repository_name=repository_name, per_page=per_page, @@ -122907,18 +130227,21 @@ async def list_repository_tags( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -122955,9 +130278,9 @@ async def list_repository_tags( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_repository_tag( @@ -122967,6 +130290,7 @@ async def delete_repository_tag( repository_tag: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Container Registry Repository Tag. To delete a container repository tag, send a DELETE request to @@ -122974,7 +130298,7 @@ async def delete_repository_tag( Note that if your repository name contains ``/`` characters, it must be URL-encoded in the request URL. For example, to delete - ``registry.digitalocean.com/example/my/repo:mytag``\ , the path would be + ``registry.digitalocean.com/example/my/repo:mytag``\\ , the path would be ``/v2/registry/example/repositories/my%2Frepo/tags/mytag``. A successful request will receive a 204 status code with no body in response. @@ -123006,10 +130330,14 @@ async def delete_repository_tag( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123018,27 +130346,30 @@ async def delete_repository_tag( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_registry_delete_repository_tag_request( + _request = build_registry_delete_repository_tag_request( registry_name=registry_name, repository_name=repository_name, repository_tag=repository_tag, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -123071,9 +130402,9 @@ async def delete_repository_tag( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_repository_manifests( @@ -123085,6 +130416,7 @@ async def list_repository_manifests( page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Container Registry Repository Manifests. To list all manifests in your container registry repository, send a GET @@ -123092,7 +130424,7 @@ async def list_repository_manifests( Note that if your repository name contains ``/`` characters, it must be URL-encoded in the request URL. For example, to list manifests for - ``registry.digitalocean.com/example/my/repo``\ , the path would be + ``registry.digitalocean.com/example/my/repo``\\ , the path would be ``/v2/registry/example/repositories/my%2Frepo/digests``. :param registry_name: The name of a container registry. Required. @@ -123113,6 +130445,9 @@ async def list_repository_manifests( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "links": { "pages": {} }, @@ -123142,10 +130477,7 @@ async def list_repository_manifests( "updated_at": "2020-02-20 00:00:00" # Optional. The time the manifest was last updated. } - ], - "meta": { - "total": 0 # Optional. Number of objects returned by the request. - } + ] } # response body for status code(s): 404 response == { @@ -123159,10 +130491,14 @@ async def list_repository_manifests( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123171,9 +130507,9 @@ async def list_repository_manifests( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_repository_manifests_request( + _request = build_registry_list_repository_manifests_request( registry_name=registry_name, repository_name=repository_name, per_page=per_page, @@ -123181,18 +130517,21 @@ async def list_repository_manifests( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -123229,9 +130568,9 @@ async def list_repository_manifests( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_repository_manifest( @@ -123241,6 +130580,7 @@ async def delete_repository_manifest( manifest_digest: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Container Registry Repository Manifest. To delete a container repository manifest by digest, send a DELETE request to @@ -123248,7 +130588,7 @@ async def delete_repository_manifest( Note that if your repository name contains ``/`` characters, it must be URL-encoded in the request URL. For example, to delete - ``registry.digitalocean.com/example/my/repo@sha256:abcd``\ , the path would be + ``registry.digitalocean.com/example/my/repo@sha256:abcd``\\ , the path would be ``/v2/registry/example/repositories/my%2Frepo/digests/sha256:abcd``. A successful request will receive a 204 status code with no body in response. @@ -123280,10 +130620,14 @@ async def delete_repository_manifest( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123292,27 +130636,30 @@ async def delete_repository_manifest( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_registry_delete_repository_manifest_request( + _request = build_registry_delete_repository_manifest_request( registry_name=registry_name, repository_name=repository_name, manifest_digest=manifest_digest, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -123345,12 +130692,13 @@ async def delete_repository_manifest( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def run_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Start Garbage Collection. Garbage collection enables users to clear out unreferenced blobs (layer & @@ -123419,10 +130767,14 @@ async def run_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSO tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123431,25 +130783,28 @@ async def run_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_run_garbage_collection_request( + _request = build_registry_run_garbage_collection_request( registry_name=registry_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -123486,12 +130841,13 @@ async def run_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Active Garbage Collection. To get information about the currently-active garbage collection for a registry, send a GET @@ -123539,10 +130895,14 @@ async def get_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSO tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123551,25 +130911,28 @@ async def get_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_garbage_collection_request( + _request = build_registry_get_garbage_collection_request( registry_name=registry_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -123606,14 +130969,15 @@ async def get_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_garbage_collections( self, registry_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Garbage Collections. To get information about past garbage collections for a registry, send a GET request to @@ -123667,10 +131031,14 @@ async def list_garbage_collections( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123679,27 +131047,30 @@ async def list_garbage_collections( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_garbage_collections_request( + _request = build_registry_list_garbage_collections_request( registry_name=registry_name, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -123736,9 +131107,9 @@ async def list_garbage_collections( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_garbage_collection( @@ -123750,6 +131121,7 @@ async def update_garbage_collection( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Garbage Collection. To cancel the currently-active garbage collection for a registry, send a PUT request to @@ -123817,11 +131189,12 @@ async def update_garbage_collection( self, registry_name: str, garbage_collection_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Garbage Collection. To cancel the currently-active garbage collection for a registry, send a PUT request to @@ -123833,7 +131206,7 @@ async def update_garbage_collection( :param garbage_collection_uuid: The UUID of a garbage collection run. Required. :type garbage_collection_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -123883,9 +131256,10 @@ async def update_garbage_collection( self, registry_name: str, garbage_collection_uuid: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Garbage Collection. To cancel the currently-active garbage collection for a registry, send a PUT request to @@ -123896,11 +131270,8 @@ async def update_garbage_collection( :type registry_name: str :param garbage_collection_uuid: The UUID of a garbage collection run. Required. :type garbage_collection_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -123908,6 +131279,12 @@ async def update_garbage_collection( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "cancel": bool # Optional. A boolean value indicating that the garbage + collection should be cancelled. + } + # response body for status code(s): 200 response == { "garbage_collection": { @@ -123941,10 +131318,14 @@ async def update_garbage_collection( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123953,20 +131334,20 @@ async def update_garbage_collection( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_registry_update_garbage_collection_request( + _request = build_registry_update_garbage_collection_request( registry_name=registry_name, garbage_collection_uuid=garbage_collection_uuid, content_type=content_type, @@ -123975,18 +131356,21 @@ async def update_garbage_collection( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124023,12 +131407,13 @@ async def update_garbage_collection( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_options(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Registry Options (Subscription Tiers and Available Regions). This endpoint serves to provide additional information as to which option values are available @@ -124088,10 +131473,14 @@ async def get_options(self, **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124100,24 +131489,27 @@ async def get_options(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_options_request( + _request = build_registry_get_options_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124137,9 +131529,9 @@ async def get_options(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class ReservedIPsOperations: @@ -124163,6 +131555,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Reserved IPs. To list all of the reserved IPs available on your account, send a GET request to @@ -124181,12 +131574,12 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "reserved_ips": [ { "droplet": {}, @@ -124216,10 +131609,14 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124228,26 +131625,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_reserved_ips_list_request( + _request = build_reserved_ips_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124267,14 +131667,15 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Reserved IP. On creation, a reserved IP must be either assigned to a Droplet or reserved to a region. @@ -124288,8 +131689,8 @@ async def create( To create a new reserved IP reserved to a region, send a POST request to ``/v2/reserved_ips`` with the ``region`` attribute. - **Note**\ : In addition to the standard rate limiting, only 12 reserved IPs may be created per - 60 seconds. + **Note**\\ : In addition to the standard rate limiting, only 12 reserved IPs may be created + per 60 seconds. :param body: Required. :type body: JSON @@ -124359,8 +131760,9 @@ async def create( @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Reserved IP. On creation, a reserved IP must be either assigned to a Droplet or reserved to a region. @@ -124374,11 +131776,11 @@ async def create( To create a new reserved IP reserved to a region, send a POST request to ``/v2/reserved_ips`` with the ``region`` attribute. - **Note**\ : In addition to the standard rate limiting, only 12 reserved IPs may be created per - 60 seconds. + **Note**\\ : In addition to the standard rate limiting, only 12 reserved IPs may be created + per 60 seconds. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -124441,7 +131843,8 @@ async def create( """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Reserved IP. On creation, a reserved IP must be either assigned to a Droplet or reserved to a region. @@ -124455,14 +131858,11 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: To create a new reserved IP reserved to a region, send a POST request to ``/v2/reserved_ips`` with the ``region`` attribute. - **Note**\ : In addition to the standard rate limiting, only 12 reserved IPs may be created per - 60 seconds. + **Note**\\ : In addition to the standard rate limiting, only 12 reserved IPs may be created + per 60 seconds. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -124470,6 +131870,9 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 202 response == { "links": { @@ -124520,10 +131923,14 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124532,38 +131939,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_reserved_ips_create_request( + _request = build_reserved_ips_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124583,12 +131993,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, reserved_ip: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Reserved IP. To show information about a reserved IP, send a GET request to @@ -124642,10 +132053,14 @@ async def get(self, reserved_ip: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124654,25 +132069,28 @@ async def get(self, reserved_ip: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_reserved_ips_get_request( + _request = build_reserved_ips_get_request( reserved_ip=reserved_ip, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124709,12 +132127,13 @@ async def get(self, reserved_ip: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, reserved_ip: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Reserved IP. To delete a reserved IP and remove it from your account, send a DELETE request @@ -124744,10 +132163,14 @@ async def delete(self, reserved_ip: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124756,25 +132179,28 @@ async def delete(self, reserved_ip: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_reserved_ips_delete_request( + _request = build_reserved_ips_delete_request( reserved_ip=reserved_ip, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -124807,9 +132233,9 @@ async def delete(self, reserved_ip: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class ReservedIPsActionsOperations: @@ -124833,6 +132259,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, reserved_ip: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Actions for a Reserved IP. To retrieve all actions that have been executed on a reserved IP, send a GET request to @@ -124849,6 +132276,9 @@ async def list(self, reserved_ip: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -124890,9 +132320,6 @@ async def list(self, reserved_ip: str, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -124907,10 +132334,14 @@ async def list(self, reserved_ip: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124919,25 +132350,28 @@ async def list(self, reserved_ip: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_reserved_ips_actions_list_request( + _request = build_reserved_ips_actions_list_request( reserved_ip=reserved_ip, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124974,9 +132408,9 @@ async def list(self, reserved_ip: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def post( @@ -124987,6 +132421,7 @@ async def post( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate a Reserved IP Action. To initiate an action on a reserved IP send a POST request to @@ -125078,11 +132513,12 @@ async def post( async def post( self, reserved_ip: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate a Reserved IP Action. To initiate an action on a reserved IP send a POST request to @@ -125103,7 +132539,7 @@ async def post( :type reserved_ip: str :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the reserved IP. Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -125169,8 +132605,12 @@ async def post( @distributed_trace_async async def post( - self, reserved_ip: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + reserved_ip: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate a Reserved IP Action. To initiate an action on a reserved IP send a POST request to @@ -125190,11 +132630,9 @@ async def post( :param reserved_ip: A reserved IP address. Required. :type reserved_ip: str :param body: The ``type`` attribute set in the request body will specify the action that - will be taken on the reserved IP. Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + will be taken on the reserved IP. Is either a JSON type or a IO[bytes] type. Default value is + None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -125202,6 +132640,9 @@ async def post( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "action": { @@ -125254,10 +132695,14 @@ async def post( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125266,15 +132711,15 @@ async def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -125282,7 +132727,7 @@ async def post( else: _json = None - request = build_reserved_ips_actions_post_request( + _request = build_reserved_ips_actions_post_request( reserved_ip=reserved_ip, content_type=content_type, json=_json, @@ -125290,18 +132735,21 @@ async def post( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125338,12 +132786,13 @@ async def post( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, reserved_ip: str, action_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Reserved IP Action. To retrieve the status of a reserved IP action, send a GET request to @@ -125413,10 +132862,14 @@ async def get(self, reserved_ip: str, action_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125425,26 +132878,29 @@ async def get(self, reserved_ip: str, action_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_reserved_ips_actions_get_request( + _request = build_reserved_ips_actions_get_request( reserved_ip=reserved_ip, action_id=action_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125481,9 +132937,9 @@ async def get(self, reserved_ip: str, action_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class SizesOperations: @@ -125507,6 +132963,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Droplet Sizes. To list all of available Droplet sizes, send a GET request to ``/v2/sizes``. @@ -125526,9 +132983,6 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, @@ -125562,13 +133016,20 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO "vcpus": 0 # The integer of number CPUs allocated to Droplets of this size. Required. } - ] + ], + "links": { + "pages": {} + } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125577,26 +133038,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_sizes_list_request( + _request = build_sizes_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125616,9 +133080,9 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class SnapshotsOperations: @@ -125649,6 +133113,7 @@ async def list( resource_type: Optional[str] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Snapshots. To list all of the snapshots available on your account, send a GET request to @@ -125691,12 +133156,12 @@ async def list( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "snapshots": [ { "created_at": "2020-02-20 00:00:00", # A time value given in @@ -125726,10 +133191,14 @@ async def list( ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125738,27 +133207,30 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_snapshots_list_request( + _request = build_snapshots_list_request( per_page=per_page, page=page, resource_type=resource_type, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125778,12 +133250,13 @@ async def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Snapshot. To retrieve information about a snapshot, send a GET request to @@ -125840,10 +133313,14 @@ async def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125852,25 +133329,28 @@ async def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_snapshots_get_request( + _request = build_snapshots_get_request( snapshot_id=snapshot_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125923,12 +133403,13 @@ async def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Snapshot. Both Droplet and volume snapshots are managed through the ``/v2/snapshots/`` @@ -125960,10 +133441,14 @@ async def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125972,25 +133457,28 @@ async def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_snapshots_delete_request( + _request = build_snapshots_delete_request( snapshot_id=snapshot_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -126039,9 +133527,9 @@ async def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class TagsOperations: @@ -126065,6 +133553,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Tags. To list all of your tags, you can send a GET request to ``/v2/tags``. @@ -126082,23 +133571,23 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "tags": [ { "name": "str", # Optional. The name of the tag. Tags may - contain letters, numbers, colons, dashes, and underscores."nThere is a - limit of 255 characters per tag."n"n**Note:** Tag names are case stable, + contain letters, numbers, colons, dashes, and underscores. There is a + limit of 255 characters per tag. **Note:** Tag names are case stable, which means the capitalization you use when you first create a tag is - canonical."n"nWhen working with tags in the API, you must use the tag's + canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will always display the canonical capitalization. For example, if you create a tag named "PROD", you can tag resources in the control panel by entering "prod". The tag will still display with its canonical @@ -126143,10 +133632,14 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126155,26 +133648,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_tags_list_request( + _request = build_tags_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -126194,14 +133690,15 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Tag. To create a tag you can send a POST request to ``/v2/tags`` with a ``name`` attribute. @@ -126221,13 +133718,13 @@ async def create( # JSON input template you can fill out and use as your body input. body = { "name": "str", # Optional. The name of the tag. Tags may contain letters, - numbers, colons, dashes, and underscores."nThere is a limit of 255 characters per - tag."n"n**Note:** Tag names are case stable, which means the capitalization you - use when you first create a tag is canonical."n"nWhen working with tags in the - API, you must use the tag's canonical capitalization. For example, if you create - a tag named "PROD", the URL to add that tag to a resource would be + numbers, colons, dashes, and underscores. There is a limit of 255 characters per + tag. **Note:** Tag names are case stable, which means the capitalization you use + when you first create a tag is canonical. When working with tags in the API, you + must use the tag's canonical capitalization. For example, if you create a tag + named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel will + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will always display the canonical capitalization. For example, if you create a tag named "PROD", you can tag resources in the control panel by entering "prod". The tag will still display with its canonical capitalization, "PROD". @@ -126273,17 +133770,17 @@ async def create( response == { "tag": { "name": "str", # Optional. The name of the tag. Tags may contain - letters, numbers, colons, dashes, and underscores."nThere is a limit of 255 - characters per tag."n"n**Note:** Tag names are case stable, which means the - capitalization you use when you first create a tag is canonical."n"nWhen + letters, numbers, colons, dashes, and underscores. There is a limit of 255 + characters per tag. **Note:** Tag names are case stable, which means the + capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel - will always display the canonical capitalization. For example, if you create - a tag named "PROD", you can tag resources in the control panel by entering - "prod". The tag will still display with its canonical capitalization, "PROD". + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". + The tag will still display with its canonical capitalization, "PROD". "resources": { "count": 0, # Optional. The number of tagged objects for this type of resource. @@ -126325,26 +133822,27 @@ async def create( # response body for status code(s): 400 response == { "error": "str", # A message providing information about the error. Required. - "messages": [ - "str" # Optional. A list of error messages. - ], "root_causes": [ "str" # A list of underlying causes for the error, including details to help resolve it when possible. Required. + ], + "messages": [ + "str" # Optional. A list of error messages. ] } """ @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Tag. To create a tag you can send a POST request to ``/v2/tags`` with a ``name`` attribute. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -126359,17 +133857,17 @@ async def create( response == { "tag": { "name": "str", # Optional. The name of the tag. Tags may contain - letters, numbers, colons, dashes, and underscores."nThere is a limit of 255 - characters per tag."n"n**Note:** Tag names are case stable, which means the - capitalization you use when you first create a tag is canonical."n"nWhen + letters, numbers, colons, dashes, and underscores. There is a limit of 255 + characters per tag. **Note:** Tag names are case stable, which means the + capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel - will always display the canonical capitalization. For example, if you create - a tag named "PROD", you can tag resources in the control panel by entering - "prod". The tag will still display with its canonical capitalization, "PROD". + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". + The tag will still display with its canonical capitalization, "PROD". "resources": { "count": 0, # Optional. The number of tagged objects for this type of resource. @@ -126411,27 +133909,25 @@ async def create( # response body for status code(s): 400 response == { "error": "str", # A message providing information about the error. Required. - "messages": [ - "str" # Optional. A list of error messages. - ], "root_causes": [ "str" # A list of underlying causes for the error, including details to help resolve it when possible. Required. + ], + "messages": [ + "str" # Optional. A list of error messages. ] } """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Tag. To create a tag you can send a POST request to ``/v2/tags`` with a ``name`` attribute. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -126439,21 +133935,72 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # Optional. The name of the tag. Tags may contain letters, + numbers, colons, dashes, and underscores. There is a limit of 255 characters per + tag. **Note:** Tag names are case stable, which means the capitalization you use + when you first create a tag is canonical. When working with tags in the API, you + must use the tag's canonical capitalization. For example, if you create a tag + named "PROD", the URL to add that tag to a resource would be + ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". The + tag will still display with its canonical capitalization, "PROD". + "resources": { + "count": 0, # Optional. The number of tagged objects for this type + of resource. + "databases": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + }, + "droplets": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + }, + "imgages": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + }, + "last_tagged_uri": "str", # Optional. The URI for the last tagged + object for this type of resource. + "volume_snapshots": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + }, + "volumes": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + } + } + } + # response body for status code(s): 201 response == { "tag": { "name": "str", # Optional. The name of the tag. Tags may contain - letters, numbers, colons, dashes, and underscores."nThere is a limit of 255 - characters per tag."n"n**Note:** Tag names are case stable, which means the - capitalization you use when you first create a tag is canonical."n"nWhen + letters, numbers, colons, dashes, and underscores. There is a limit of 255 + characters per tag. **Note:** Tag names are case stable, which means the + capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel - will always display the canonical capitalization. For example, if you create - a tag named "PROD", you can tag resources in the control panel by entering - "prod". The tag will still display with its canonical capitalization, "PROD". + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". + The tag will still display with its canonical capitalization, "PROD". "resources": { "count": 0, # Optional. The number of tagged objects for this type of resource. @@ -126495,19 +134042,23 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: # response body for status code(s): 400 response == { "error": "str", # A message providing information about the error. Required. - "messages": [ - "str" # Optional. A list of error messages. - ], "root_causes": [ "str" # A list of underlying causes for the error, including details to help resolve it when possible. Required. + ], + "messages": [ + "str" # Optional. A list of error messages. ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126516,38 +134067,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_tags_create_request( + _request = build_tags_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 400]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -126587,12 +134141,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, tag_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve a Tag. To retrieve an individual tag, you can send a ``GET`` request to ``/v2/tags/$TAG_NAME``. @@ -126611,17 +134166,17 @@ async def get(self, tag_id: str, **kwargs: Any) -> JSON: response == { "tag": { "name": "str", # Optional. The name of the tag. Tags may contain - letters, numbers, colons, dashes, and underscores."nThere is a limit of 255 - characters per tag."n"n**Note:** Tag names are case stable, which means the - capitalization you use when you first create a tag is canonical."n"nWhen + letters, numbers, colons, dashes, and underscores. There is a limit of 255 + characters per tag. **Note:** Tag names are case stable, which means the + capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel - will always display the canonical capitalization. For example, if you create - a tag named "PROD", you can tag resources in the control panel by entering - "prod". The tag will still display with its canonical capitalization, "PROD". + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". + The tag will still display with its canonical capitalization, "PROD". "resources": { "count": 0, # Optional. The number of tagged objects for this type of resource. @@ -126672,10 +134227,14 @@ async def get(self, tag_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126684,25 +134243,28 @@ async def get(self, tag_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_tags_get_request( + _request = build_tags_get_request( tag_id=tag_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -126739,12 +134301,13 @@ async def get(self, tag_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, tag_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Tag. A tag can be deleted by sending a ``DELETE`` request to ``/v2/tags/$TAG_NAME``. Deleting a tag @@ -126772,10 +134335,14 @@ async def delete(self, tag_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126784,25 +134351,28 @@ async def delete(self, tag_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_tags_delete_request( + _request = build_tags_delete_request( tag_id=tag_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -126835,9 +134405,9 @@ async def delete(self, tag_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def assign_resources( @@ -126848,14 +134418,15 @@ async def assign_resources( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Tag a Resource. Resources can be tagged by sending a POST request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. @@ -126901,25 +134472,26 @@ async def assign_resources( async def assign_resources( self, tag_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Tag a Resource. Resources can be tagged by sending a POST request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. :type tag_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -126945,25 +134517,23 @@ async def assign_resources( @distributed_trace_async async def assign_resources( - self, tag_id: str, body: Union[JSON, IO], **kwargs: Any + self, tag_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Tag a Resource. Resources can be tagged by sending a POST request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. :type tag_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -126971,6 +134541,18 @@ async def assign_resources( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "resources": [ + { + "resource_id": "str", # Optional. The identifier of a + resource. + "resource_type": "str" # Optional. The type of the resource. + Known values are: "droplet", "image", "volume", and "volume_snapshot". + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -126983,10 +134565,14 @@ async def assign_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126995,20 +134581,20 @@ async def assign_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_tags_assign_resources_request( + _request = build_tags_assign_resources_request( tag_id=tag_id, content_type=content_type, json=_json, @@ -127016,18 +134602,21 @@ async def assign_resources( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -127060,9 +134649,9 @@ async def assign_resources( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload async def unassign_resources( @@ -127073,14 +134662,15 @@ async def unassign_resources( content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Untag a Resource. Resources can be untagged by sending a DELETE request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. @@ -127126,25 +134716,26 @@ async def unassign_resources( async def unassign_resources( self, tag_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Untag a Resource. Resources can be untagged by sending a DELETE request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. :type tag_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -127170,25 +134761,23 @@ async def unassign_resources( @distributed_trace_async async def unassign_resources( - self, tag_id: str, body: Union[JSON, IO], **kwargs: Any + self, tag_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Untag a Resource. Resources can be untagged by sending a DELETE request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. :type tag_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -127196,6 +134785,18 @@ async def unassign_resources( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "resources": [ + { + "resource_id": "str", # Optional. The identifier of a + resource. + "resource_type": "str" # Optional. The type of the resource. + Known values are: "droplet", "image", "volume", and "volume_snapshot". + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -127208,10 +134809,14 @@ async def unassign_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127220,20 +134825,20 @@ async def unassign_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_tags_unassign_resources_request( + _request = build_tags_unassign_resources_request( tag_id=tag_id, content_type=content_type, json=_json, @@ -127241,18 +134846,21 @@ async def unassign_resources( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -127285,9 +134893,9 @@ async def unassign_resources( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class VolumesOperations: @@ -127319,6 +134927,7 @@ async def list( page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Block Storage Volumes. To list all of the block storage volumes available on your account, send a GET request to @@ -127366,9 +134975,6 @@ async def list( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, @@ -127418,13 +135024,20 @@ async def list( existing or new tags. ] } - ] + ], + "links": { + "pages": {} + } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127433,9 +135046,9 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volumes_list_request( + _request = build_volumes_list_request( name=name, region=region, per_page=per_page, @@ -127443,18 +135056,21 @@ async def list( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -127474,14 +135090,15 @@ async def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Block Storage Volume. To create a new volume, send a POST request to ``/v2/volumes``. Optionally, a @@ -127566,8 +135183,9 @@ async def create( @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Block Storage Volume. To create a new volume, send a POST request to ``/v2/volumes``. Optionally, a @@ -127577,7 +135195,7 @@ async def create( pre-formatted volumes to Droplets without support for auto-mounting is not recommended. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -127648,7 +135266,8 @@ async def create( """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Block Storage Volume. To create a new volume, send a POST request to ``/v2/volumes``. Optionally, a @@ -127657,11 +135276,8 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -127669,6 +135285,9 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "volume": { @@ -127727,10 +135346,14 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127739,38 +135362,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_volumes_create_request( + _request = build_volumes_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -127823,14 +135449,15 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_by_name( self, *, name: Optional[str] = None, region: Optional[str] = None, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Block Storage Volume by Name. Block storage volumes may also be deleted by name by sending a DELETE request with the volume's @@ -127865,10 +135492,14 @@ async def delete_by_name( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127877,26 +135508,29 @@ async def delete_by_name( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_volumes_delete_by_name_request( + _request = build_volumes_delete_by_name_request( name=name, region=region, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -127929,12 +135563,13 @@ async def delete_by_name( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get(self, volume_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Block Storage Volume. To show information about a block storage volume, send a GET request to @@ -128007,10 +135642,14 @@ async def get(self, volume_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128019,25 +135658,28 @@ async def get(self, volume_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volumes_get_request( + _request = build_volumes_get_request( volume_id=volume_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -128074,12 +135716,13 @@ async def get(self, volume_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, volume_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Block Storage Volume. To delete a block storage volume, destroying all data and removing it from your account, send a @@ -128109,10 +135752,14 @@ async def delete(self, volume_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128121,25 +135768,28 @@ async def delete(self, volume_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_volumes_delete_request( + _request = build_volumes_delete_request( volume_id=volume_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -128172,9 +135822,9 @@ async def delete(self, volume_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class VolumeActionsOperations: @@ -128206,6 +135856,7 @@ async def post( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Name. To initiate an action on a block storage volume by Name, send a POST request to @@ -128327,13 +135978,14 @@ async def post( @overload async def post( self, - body: IO, + body: IO[bytes], *, per_page: int = 20, page: int = 1, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Name. To initiate an action on a block storage volume by Name, send a POST request to @@ -128384,7 +136036,7 @@ async def post( - Set to the slug representing the region where the volume is located. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword per_page: Number of items returned per page. Default value is 20. :paramtype per_page: int :keyword page: Which 'page' of paginated results to return. Default value is 1. @@ -128451,8 +136103,14 @@ async def post( @distributed_trace_async async def post( - self, body: Union[JSON, IO], *, per_page: int = 20, page: int = 1, **kwargs: Any + self, + body: Union[JSON, IO[bytes]], + *, + per_page: int = 20, + page: int = 1, + **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Name. To initiate an action on a block storage volume by Name, send a POST request to @@ -128502,15 +136160,12 @@ async def post( * - region - Set to the slug representing the region where the volume is located. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword per_page: Number of items returned per page. Default value is 20. :paramtype per_page: int :keyword page: Which 'page' of paginated results to return. Default value is 1. :paramtype page: int - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -128518,6 +136173,9 @@ async def post( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 202 response == { "action": { @@ -128567,10 +136225,14 @@ async def post( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128579,20 +136241,20 @@ async def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_volume_actions_post_request( + _request = build_volume_actions_post_request( per_page=per_page, page=page, content_type=content_type, @@ -128601,18 +136263,21 @@ async def post( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -128649,14 +136314,15 @@ async def post( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list( self, volume_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Actions for a Volume. To retrieve all actions that have been executed on a volume, send a GET request to @@ -128677,6 +136343,9 @@ async def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -128717,9 +136386,6 @@ async def list( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -128734,10 +136400,14 @@ async def list( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128746,27 +136416,30 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volume_actions_list_request( + _request = build_volume_actions_list_request( volume_id=volume_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -128803,9 +136476,9 @@ async def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def post_by_id( @@ -128818,6 +136491,7 @@ async def post_by_id( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Id. To initiate an action on a block storage volume by Id, send a POST request to @@ -128957,13 +136631,14 @@ async def post_by_id( async def post_by_id( self, volume_id: str, - body: IO, + body: IO[bytes], *, per_page: int = 20, page: int = 1, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Id. To initiate an action on a block storage volume by Id, send a POST request to @@ -129031,7 +136706,7 @@ async def post_by_id( :param volume_id: The ID of the block storage volume. Required. :type volume_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword per_page: Number of items returned per page. Default value is 20. :paramtype per_page: int :keyword page: Which 'page' of paginated results to return. Default value is 1. @@ -129100,12 +136775,13 @@ async def post_by_id( async def post_by_id( self, volume_id: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Id. To initiate an action on a block storage volume by Id, send a POST request to @@ -129172,15 +136848,12 @@ async def post_by_id( :param volume_id: The ID of the block storage volume. Required. :type volume_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword per_page: Number of items returned per page. Default value is 20. :paramtype per_page: int :keyword page: Which 'page' of paginated results to return. Default value is 1. :paramtype page: int - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -129188,6 +136861,9 @@ async def post_by_id( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 202 response == { "action": { @@ -129237,10 +136913,14 @@ async def post_by_id( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129249,20 +136929,20 @@ async def post_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_volume_actions_post_by_id_request( + _request = build_volume_actions_post_by_id_request( volume_id=volume_id, per_page=per_page, page=page, @@ -129272,18 +136952,21 @@ async def post_by_id( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129320,9 +137003,9 @@ async def post_by_id( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get( @@ -129334,6 +137017,7 @@ async def get( page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Volume Action. To retrieve the status of a volume action, send a GET request to @@ -129404,10 +137088,14 @@ async def get( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129416,9 +137104,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volume_actions_get_request( + _request = build_volume_actions_get_request( volume_id=volume_id, action_id=action_id, per_page=per_page, @@ -129426,18 +137114,21 @@ async def get( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129474,9 +137165,9 @@ async def get( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class VolumeSnapshotsOperations: @@ -129500,6 +137191,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Volume Snapshot. To retrieve the details of a snapshot that has been created from a volume, send a GET request @@ -129552,10 +137244,14 @@ async def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129564,25 +137260,28 @@ async def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volume_snapshots_get_by_id_request( + _request = build_volume_snapshots_get_by_id_request( snapshot_id=snapshot_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129619,12 +137318,13 @@ async def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Volume Snapshot. To delete a volume snapshot, send a DELETE request to @@ -129654,10 +137354,14 @@ async def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129666,25 +137370,28 @@ async def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_volume_snapshots_delete_by_id_request( + _request = build_volume_snapshots_delete_by_id_request( snapshot_id=snapshot_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -129717,14 +137424,15 @@ async def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list( self, volume_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Snapshots for a Volume. To retrieve the snapshots that have been created from a volume, send a GET request to @@ -129745,12 +137453,12 @@ async def list( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "snapshots": [ { "created_at": "2020-02-20 00:00:00", # A time value given in @@ -129791,10 +137499,14 @@ async def list( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129803,27 +137515,30 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volume_snapshots_list_request( + _request = build_volume_snapshots_list_request( volume_id=volume_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129860,9 +137575,9 @@ async def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( @@ -129873,6 +137588,7 @@ async def create( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Snapshot from a Volume. To create a snapshot from a volume, sent a POST request to @@ -129944,11 +137660,12 @@ async def create( async def create( self, volume_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Snapshot from a Volume. To create a snapshot from a volume, sent a POST request to @@ -129957,7 +137674,7 @@ async def create( :param volume_id: The ID of the block storage volume. Required. :type volume_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -130009,8 +137726,9 @@ async def create( @distributed_trace_async async def create( - self, volume_id: str, body: Union[JSON, IO], **kwargs: Any + self, volume_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Snapshot from a Volume. To create a snapshot from a volume, sent a POST request to @@ -130018,11 +137736,8 @@ async def create( :param volume_id: The ID of the block storage volume. Required. :type volume_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -130030,6 +137745,15 @@ async def create( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A human-readable name for the volume snapshot. Required. + "tags": [ + "str" # Optional. A flat array of tag names as strings to be applied + to the resource. Tag names may be for either existing or new tags. + ] + } + # response body for status code(s): 201 response == { "snapshot": { @@ -130068,10 +137792,14 @@ async def create( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130080,20 +137808,20 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_volume_snapshots_create_request( + _request = build_volume_snapshots_create_request( volume_id=volume_id, content_type=content_type, json=_json, @@ -130101,18 +137829,21 @@ async def create( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130165,9 +137896,9 @@ async def create( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class VpcsOperations: @@ -130191,6 +137922,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All VPCs. To list all of the VPCs on your account, send a GET request to ``/v2/vpcs``. @@ -130208,12 +137940,12 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "vpcs": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -130257,10 +137989,14 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130269,26 +138005,29 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_vpcs_list_request( + _request = build_vpcs_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130325,14 +138064,15 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New VPC. To create a VPC, send a POST request to ``/v2/vpcs`` specifying the attributes @@ -130404,8 +138144,9 @@ async def create( @overload async def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New VPC. To create a VPC, send a POST request to ``/v2/vpcs`` specifying the attributes @@ -130416,7 +138157,7 @@ async def create( region. The default VPC for a region cannot be changed or deleted. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -130460,7 +138201,8 @@ async def create( """ @distributed_trace_async - async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New VPC. To create a VPC, send a POST request to ``/v2/vpcs`` specifying the attributes @@ -130470,11 +138212,8 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: region, the first one that you create will be set as the default for that region. The default VPC for a region cannot be changed or deleted. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -130482,6 +138221,22 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "description": "str", # Optional. A free-form text field for describing the + VPC's purpose. It may be a maximum of 255 characters. + "ip_range": "str", # Optional. The range of IP addresses in the VPC in CIDR + notation. Network ranges cannot overlap with other networks in the same account + and must be in range of private addresses as defined in RFC1918. It may not be + smaller than ``/28`` nor larger than ``/16``. If no IP range is specified, a + ``/20`` network range is generated that won't conflict with other VPC networks in + your account. + "name": "str", # Optional. The name of the VPC. Must be unique and may only + contain alphanumeric characters, dashes, and periods. + "region": "str" # Optional. The slug identifier for the region where the VPC + will be created. + } + # response body for status code(s): 201 response == { "vpc": { @@ -130513,10 +138268,14 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130525,38 +138284,41 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_vpcs_create_request( + _request = build_vpcs_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130576,12 +138338,13 @@ async def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get(self, vpc_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing VPC. To show information about an existing VPC, send a GET request to ``/v2/vpcs/$VPC_ID``. @@ -130637,10 +138400,14 @@ async def get(self, vpc_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130649,25 +138416,28 @@ async def get(self, vpc_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_vpcs_get_request( + _request = build_vpcs_get_request( vpc_id=vpc_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130704,9 +138474,9 @@ async def get(self, vpc_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update( @@ -130717,6 +138487,7 @@ async def update( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a VPC. To update information about a VPC, send a PUT request to ``/v2/vpcs/$VPC_ID``. @@ -130797,11 +138568,12 @@ async def update( async def update( self, vpc_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a VPC. To update information about a VPC, send a PUT request to ``/v2/vpcs/$VPC_ID``. @@ -130809,7 +138581,7 @@ async def update( :param vpc_id: A unique identifier for a VPC. Required. :type vpc_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -130864,18 +138636,18 @@ async def update( """ @distributed_trace_async - async def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def update( + self, vpc_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Update a VPC. To update information about a VPC, send a PUT request to ``/v2/vpcs/$VPC_ID``. :param vpc_id: A unique identifier for a VPC. Required. :type vpc_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -130883,6 +138655,21 @@ async def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSO Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "default": bool, # Optional. A boolean value indicating whether or not the + VPC is the default network for the region. All applicable resources are placed + into the default VPC network unless otherwise specified during their creation. + The ``default`` field cannot be unset from ``true``. If you want to set a new + default VPC network, update the ``default`` field of another VPC network in the + same region. The previous network's ``default`` field will be set to ``false`` + when a new default VPC has been defined. + "description": "str", # Optional. A free-form text field for describing the + VPC's purpose. It may be a maximum of 255 characters. + "name": "str" # Optional. The name of the VPC. Must be unique and may only + contain alphanumeric characters, dashes, and periods. + } + # response body for status code(s): 200 response == { "vpc": { @@ -130925,10 +138712,14 @@ async def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSO tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130937,20 +138728,20 @@ async def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSO _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_vpcs_update_request( + _request = build_vpcs_update_request( vpc_id=vpc_id, content_type=content_type, json=_json, @@ -130958,18 +138749,21 @@ async def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSO headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131006,9 +138800,9 @@ async def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def patch( @@ -131019,6 +138813,7 @@ async def patch( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Partially Update a VPC. To update a subset of information about a VPC, send a PATCH request to @@ -131100,11 +138895,12 @@ async def patch( async def patch( self, vpc_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Partially Update a VPC. To update a subset of information about a VPC, send a PATCH request to @@ -131113,7 +138909,7 @@ async def patch( :param vpc_id: A unique identifier for a VPC. Required. :type vpc_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -131168,7 +138964,10 @@ async def patch( """ @distributed_trace_async - async def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def patch( + self, vpc_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Partially Update a VPC. To update a subset of information about a VPC, send a PATCH request to @@ -131176,11 +138975,8 @@ async def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON :param vpc_id: A unique identifier for a VPC. Required. :type vpc_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -131188,6 +138984,21 @@ async def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "default": bool, # Optional. A boolean value indicating whether or not the + VPC is the default network for the region. All applicable resources are placed + into the default VPC network unless otherwise specified during their creation. + The ``default`` field cannot be unset from ``true``. If you want to set a new + default VPC network, update the ``default`` field of another VPC network in the + same region. The previous network's ``default`` field will be set to ``false`` + when a new default VPC has been defined. + "description": "str", # Optional. A free-form text field for describing the + VPC's purpose. It may be a maximum of 255 characters. + "name": "str" # Optional. The name of the VPC. Must be unique and may only + contain alphanumeric characters, dashes, and periods. + } + # response body for status code(s): 200 response == { "vpc": { @@ -131230,10 +139041,14 @@ async def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131242,20 +139057,20 @@ async def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_vpcs_patch_request( + _request = build_vpcs_patch_request( vpc_id=vpc_id, content_type=content_type, json=_json, @@ -131263,18 +139078,21 @@ async def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131311,12 +139129,13 @@ async def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete(self, vpc_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a VPC. To delete a VPC, send a DELETE request to ``/v2/vpcs/$VPC_ID``. A 204 status @@ -131348,10 +139167,14 @@ async def delete(self, vpc_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131360,25 +139183,28 @@ async def delete(self, vpc_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_vpcs_delete_request( + _request = build_vpcs_delete_request( vpc_id=vpc_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -131411,9 +139237,9 @@ async def delete(self, vpc_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def list_members( @@ -131425,6 +139251,7 @@ async def list_members( page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List the Member Resources of a VPC. To list all of the resources that are members of a VPC, send a GET request to @@ -131451,6 +139278,9 @@ async def list_members( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "links": { "pages": {} }, @@ -131463,10 +139293,7 @@ async def list_members( "urn": "str" # Optional. The uniform resource name (URN) for the resource in the format do:resource_type:resource_id. } - ], - "meta": { - "total": 0 # Optional. Number of objects returned by the request. - } + ] } # response body for status code(s): 404 response == { @@ -131480,10 +139307,14 @@ async def list_members( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131492,9 +139323,9 @@ async def list_members( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_vpcs_list_members_request( + _request = build_vpcs_list_members_request( vpc_id=vpc_id, resource_type=resource_type, per_page=per_page, @@ -131502,18 +139333,21 @@ async def list_members( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131550,9 +139384,9 @@ async def list_members( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class UptimeOperations: @@ -131578,6 +139412,7 @@ def __init__(self, *args, **kwargs) -> None: async def list_checks( self, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Checks. To list all of the Uptime checks on your account, send a GET request to ``/v2/uptime/checks``. @@ -131595,6 +139430,9 @@ async def list_checks( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "checks": [ { "enabled": True, # Optional. Default value is True. A @@ -131614,9 +139452,6 @@ async def list_checks( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -131631,10 +139466,14 @@ async def list_checks( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131643,26 +139482,29 @@ async def list_checks( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_list_checks_request( + _request = build_uptime_list_checks_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131699,14 +139541,15 @@ async def list_checks( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_check( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Check. To create an Uptime check, send a POST request to ``/v2/uptime/checks`` specifying the @@ -131761,8 +139604,9 @@ async def create_check( @overload async def create_check( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Check. To create an Uptime check, send a POST request to ``/v2/uptime/checks`` specifying the @@ -131770,7 +139614,7 @@ async def create_check( in the table below in the JSON body. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -131802,18 +139646,16 @@ async def create_check( """ @distributed_trace_async - async def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create_check(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Check. To create an Uptime check, send a POST request to ``/v2/uptime/checks`` specifying the attributes in the table below in the JSON body. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -131821,6 +139663,20 @@ async def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "enabled": True, # Optional. Default value is True. A boolean value + indicating whether the check is enabled/disabled. + "name": "str", # Optional. A human-friendly display name. + "regions": [ + "str" # Optional. An array containing the selected regions to + perform healthchecks from. + ], + "target": "str", # Optional. The endpoint to perform healthchecks on. + "type": "str" # Optional. The type of health check to perform. Known values + are: "ping", "http", and "https". + } + # response body for status code(s): 201 response == { "check": { @@ -131840,10 +139696,14 @@ async def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131852,38 +139712,41 @@ async def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_uptime_create_check_request( + _request = build_uptime_create_check_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131903,12 +139766,13 @@ async def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_check(self, check_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Check. To show information about an existing check, send a GET request to @@ -131953,10 +139817,14 @@ async def get_check(self, check_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131965,25 +139833,28 @@ async def get_check(self, check_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_get_check_request( + _request = build_uptime_get_check_request( check_id=check_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132020,9 +139891,9 @@ async def get_check(self, check_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_check( @@ -132033,6 +139904,7 @@ async def update_check( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Check. To update the settings of an Uptime check, send a PUT request to @@ -132101,11 +139973,12 @@ async def update_check( async def update_check( self, check_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Check. To update the settings of an Uptime check, send a PUT request to @@ -132114,7 +139987,7 @@ async def update_check( :param check_id: A unique identifier for a check. Required. :type check_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -132158,8 +140031,9 @@ async def update_check( @distributed_trace_async async def update_check( - self, check_id: str, body: Union[JSON, IO], **kwargs: Any + self, check_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Check. To update the settings of an Uptime check, send a PUT request to @@ -132167,11 +140041,8 @@ async def update_check( :param check_id: A unique identifier for a check. Required. :type check_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -132179,6 +140050,20 @@ async def update_check( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "enabled": True, # Optional. Default value is True. A boolean value + indicating whether the check is enabled/disabled. + "name": "str", # Optional. A human-friendly display name. + "regions": [ + "str" # Optional. An array containing the selected regions to + perform healthchecks from. + ], + "target": "str", # Optional. The endpoint to perform healthchecks on. + "type": "str" # Optional. The type of health check to perform. Known values + are: "ping", "http", and "https". + } + # response body for status code(s): 200 response == { "check": { @@ -132209,10 +140094,14 @@ async def update_check( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132221,20 +140110,20 @@ async def update_check( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_uptime_update_check_request( + _request = build_uptime_update_check_request( check_id=check_id, content_type=content_type, json=_json, @@ -132242,18 +140131,21 @@ async def update_check( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132290,12 +140182,13 @@ async def update_check( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_check(self, check_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Check. To delete an Uptime check, send a DELETE request to ``/v2/uptime/checks/$CHECK_ID``. A 204 @@ -132325,10 +140218,14 @@ async def delete_check(self, check_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132337,25 +140234,28 @@ async def delete_check(self, check_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_uptime_delete_check_request( + _request = build_uptime_delete_check_request( check_id=check_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -132388,12 +140288,13 @@ async def delete_check(self, check_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace_async async def get_check_state(self, check_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve Check State. To show information about an existing check's state, send a GET request to @@ -132449,10 +140350,14 @@ async def get_check_state(self, check_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132461,25 +140366,28 @@ async def get_check_state(self, check_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_get_check_state_request( + _request = build_uptime_get_check_state_request( check_id=check_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132516,14 +140424,15 @@ async def get_check_state(self, check_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def list_alerts( self, check_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Alerts. To list all of the alerts for an Uptime check, send a GET request to @@ -132544,6 +140453,9 @@ async def list_alerts( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "alerts": [ { "comparison": "str", # Optional. The comparison operator @@ -132579,9 +140491,6 @@ async def list_alerts( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -132596,10 +140505,14 @@ async def list_alerts( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132608,27 +140521,30 @@ async def list_alerts( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_list_alerts_request( + _request = build_uptime_list_alerts_request( check_id=check_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132665,9 +140581,9 @@ async def list_alerts( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def create_alert( @@ -132678,6 +140594,7 @@ async def create_alert( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Alert. To create an Uptime alert, send a POST request to ``/v2/uptime/checks/$CHECK_ID/alerts`` @@ -132783,11 +140700,12 @@ async def create_alert( async def create_alert( self, check_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Alert. To create an Uptime alert, send a POST request to ``/v2/uptime/checks/$CHECK_ID/alerts`` @@ -132804,7 +140722,7 @@ async def create_alert( ``down`` | alerts on a target registering as down in any region | N/A (Not required) ``down_global`` | alerts on a target registering as down globally | N/A (Not required) ``ssl_expiry`` | alerts on a SSL certificate expiring within $threshold days | days. Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -132862,8 +140780,9 @@ async def create_alert( @distributed_trace_async async def create_alert( - self, check_id: str, body: Union[JSON, IO], **kwargs: Any + self, check_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Alert. To create an Uptime alert, send a POST request to ``/v2/uptime/checks/$CHECK_ID/alerts`` @@ -132880,11 +140799,8 @@ async def create_alert( ``down`` | alerts on a target registering as down in any region | N/A (Not required) ``down_global`` | alerts on a target registering as down globally | N/A (Not required) ``ssl_expiry`` | alerts on a SSL certificate expiring within $threshold days | days. Is either - a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -132892,6 +140808,35 @@ async def create_alert( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "comparison": "str", # Optional. The comparison operator used against the + alert's threshold. Known values are: "greater_than" and "less_than". + "id": "str", # Optional. A unique ID that can be used to identify and + reference the alert. + "name": "str", # Optional. A human-friendly display name. + "notifications": { + "email": [ + "str" # An email to notify on an alert trigger. The Email + has to be one that is verified on that DigitalOcean account. Required. + ], + "slack": [ + { + "channel": "str", # Slack channel to notify of an + alert trigger. Required. + "url": "str" # Slack Webhook URL. Required. + } + ] + }, + "period": "str", # Optional. Period of time the threshold must be exceeded + to trigger the alert. Known values are: "2m", "3m", "5m", "10m", "15m", "30m", + and "1h". + "threshold": 0, # Optional. The threshold at which the alert will enter a + trigger state. The specific threshold is dependent on the alert type. + "type": "str" # Optional. The type of alert. Known values are: "latency", + "down", "down_global", and "ssl_expiry". + } + # response body for status code(s): 201 response == { "alert": { @@ -132936,10 +140881,14 @@ async def create_alert( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132948,20 +140897,20 @@ async def create_alert( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_uptime_create_alert_request( + _request = build_uptime_create_alert_request( check_id=check_id, content_type=content_type, json=_json, @@ -132969,18 +140918,21 @@ async def create_alert( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -133017,12 +140969,13 @@ async def create_alert( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_alert(self, check_id: str, alert_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Alert. To show information about an existing alert, send a GET request to @@ -133083,10 +141036,14 @@ async def get_alert(self, check_id: str, alert_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -133095,26 +141052,29 @@ async def get_alert(self, check_id: str, alert_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_get_alert_request( + _request = build_uptime_get_alert_request( check_id=check_id, alert_id=alert_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -133151,9 +141111,9 @@ async def get_alert(self, check_id: str, alert_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload async def update_alert( @@ -133165,6 +141125,7 @@ async def update_alert( content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Alert. To update the settings of an Uptime alert, send a PUT request to @@ -133263,11 +141224,12 @@ async def update_alert( self, check_id: str, alert_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Alert. To update the settings of an Uptime alert, send a PUT request to @@ -133278,7 +141240,7 @@ async def update_alert( :param alert_id: A unique identifier for an alert. Required. :type alert_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -133336,8 +141298,9 @@ async def update_alert( @distributed_trace_async async def update_alert( - self, check_id: str, alert_id: str, body: Union[JSON, IO], **kwargs: Any + self, check_id: str, alert_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Alert. To update the settings of an Uptime alert, send a PUT request to @@ -133347,11 +141310,8 @@ async def update_alert( :type check_id: str :param alert_id: A unique identifier for an alert. Required. :type alert_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -133359,6 +141319,33 @@ async def update_alert( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "comparison": "str", # Optional. The comparison operator used against the + alert's threshold. Known values are: "greater_than" and "less_than". + "name": "str", # Optional. A human-friendly display name. + "notifications": { + "email": [ + "str" # An email to notify on an alert trigger. The Email + has to be one that is verified on that DigitalOcean account. Required. + ], + "slack": [ + { + "channel": "str", # Slack channel to notify of an + alert trigger. Required. + "url": "str" # Slack Webhook URL. Required. + } + ] + }, + "period": "str", # Optional. Period of time the threshold must be exceeded + to trigger the alert. Known values are: "2m", "3m", "5m", "10m", "15m", "30m", + and "1h". + "threshold": 0, # Optional. The threshold at which the alert will enter a + trigger state. The specific threshold is dependent on the alert type. + "type": "str" # Optional. The type of alert. Known values are: "latency", + "down", "down_global", and "ssl_expiry". + } + # response body for status code(s): 200 response == { "alert": { @@ -133403,10 +141390,14 @@ async def update_alert( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -133415,20 +141406,20 @@ async def update_alert( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_uptime_update_alert_request( + _request = build_uptime_update_alert_request( check_id=check_id, alert_id=alert_id, content_type=content_type, @@ -133437,18 +141428,21 @@ async def update_alert( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -133485,14 +141479,15 @@ async def update_alert( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_alert( self, check_id: str, alert_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Alert. To delete an Uptime alert, send a DELETE request to @@ -133522,10 +141517,14 @@ async def delete_alert( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -133534,26 +141533,29 @@ async def delete_alert( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_uptime_delete_alert_request( + _request = build_uptime_delete_alert_request( check_id=check_id, alert_id=alert_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -133586,6 +141588,6 @@ async def delete_alert( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore diff --git a/src/pydo/operations/__init__.py b/src/pydo/operations/__init__.py index 1d6bd211..930e654c 100644 --- a/src/pydo/operations/__init__.py +++ b/src/pydo/operations/__init__.py @@ -1,6 +1,6 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -40,7 +40,7 @@ from ._operations import UptimeOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/src/pydo/operations/_operations.py b/src/pydo/operations/_operations.py index c8067477..489214dd 100644 --- a/src/pydo/operations/_operations.py +++ b/src/pydo/operations/_operations.py @@ -1,10 +1,11 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.0.1) +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.0, generator: @autorest/python@6.13.16) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime +from io import IOBase import sys from typing import ( Any, @@ -13,6 +14,7 @@ IO, Iterator, Optional, + Type, TypeVar, Union, cast, @@ -24,16 +26,15 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from .._serialization import Serializer -from .._vendor import _format_url_section if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -72,12 +73,14 @@ def build_one_clicks_list_request( ) -def build_one_clicks_install_kubernetes_request(**kwargs: Any) -> HttpRequest: +def build_one_clicks_install_kubernetes_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,9 +140,9 @@ def build_ssh_keys_list_request( def build_ssh_keys_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +171,7 @@ def build_ssh_keys_get_request(ssh_key_identifier: JSON, **kwargs: Any) -> HttpR ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -181,9 +184,9 @@ def build_ssh_keys_update_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +197,7 @@ def build_ssh_keys_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -221,7 +224,7 @@ def build_ssh_keys_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -267,7 +270,7 @@ def build_actions_get_request(action_id: int, **kwargs: Any) -> HttpRequest: "action_id": _SERIALIZER.url("action_id", action_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -313,9 +316,9 @@ def build_apps_list_request( def build_apps_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +345,7 @@ def build_apps_delete_request(id: str, **kwargs: Any) -> HttpRequest: "id": _SERIALIZER.url("id", id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -364,7 +367,7 @@ def build_apps_get_request( "id": _SERIALIZER.url("id", id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if name is not None: @@ -381,9 +384,9 @@ def build_apps_get_request( def build_apps_update_request(id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -392,7 +395,7 @@ def build_apps_update_request(id: str, **kwargs: Any) -> HttpRequest: "id": _SERIALIZER.url("id", id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -404,7 +407,7 @@ def build_apps_update_request(id: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_apps_get_logs_active_deployment_request( +def build_apps_get_logs_active_deployment_request( # pylint: disable=name-too-long app_id: str, component_name: str, *, @@ -425,7 +428,7 @@ def build_apps_get_logs_active_deployment_request( "component_name": _SERIALIZER.url("component_name", component_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if follow is not None: @@ -458,7 +461,7 @@ def build_apps_list_deployments_request( "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if page is not None: @@ -479,9 +482,9 @@ def build_apps_list_deployments_request( def build_apps_create_deployment_request(app_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -490,7 +493,7 @@ def build_apps_create_deployment_request(app_id: str, **kwargs: Any) -> HttpRequ "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -516,7 +519,7 @@ def build_apps_get_deployment_request( "deployment_id": _SERIALIZER.url("deployment_id", deployment_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -538,7 +541,7 @@ def build_apps_cancel_deployment_request( "deployment_id": _SERIALIZER.url("deployment_id", deployment_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -571,7 +574,7 @@ def build_apps_get_logs_request( "component_name": _SERIALIZER.url("component_name", component_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if follow is not None: @@ -611,7 +614,7 @@ def build_apps_get_logs_aggregate_request( "deployment_id": _SERIALIZER.url("deployment_id", deployment_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if follow is not None: @@ -630,7 +633,7 @@ def build_apps_get_logs_aggregate_request( ) -def build_apps_get_logs_active_deployment_aggregate_request( +def build_apps_get_logs_active_deployment_aggregate_request( # pylint: disable=name-too-long app_id: str, *, follow: Optional[bool] = None, @@ -649,7 +652,7 @@ def build_apps_get_logs_active_deployment_aggregate_request( "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if follow is not None: @@ -693,7 +696,7 @@ def build_apps_get_tier_request(slug: str, **kwargs: Any) -> HttpRequest: "slug": _SERIALIZER.url("slug", slug, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -726,7 +729,7 @@ def build_apps_get_instance_size_request(slug: str, **kwargs: Any) -> HttpReques "slug": _SERIALIZER.url("slug", slug, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -751,9 +754,9 @@ def build_apps_list_regions_request(**kwargs: Any) -> HttpRequest: def build_apps_validate_app_spec_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -780,7 +783,7 @@ def build_apps_list_alerts_request(app_id: str, **kwargs: Any) -> HttpRequest: "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -788,14 +791,14 @@ def build_apps_list_alerts_request(app_id: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_apps_assign_alert_destinations_request( +def build_apps_assign_alert_destinations_request( # pylint: disable=name-too-long app_id: str, alert_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -805,7 +808,7 @@ def build_apps_assign_alert_destinations_request( "alert_id": _SERIALIZER.url("alert_id", alert_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -820,9 +823,9 @@ def build_apps_assign_alert_destinations_request( def build_apps_create_rollback_request(app_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -831,7 +834,7 @@ def build_apps_create_rollback_request(app_id: str, **kwargs: Any) -> HttpReques "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -846,9 +849,9 @@ def build_apps_create_rollback_request(app_id: str, **kwargs: Any) -> HttpReques def build_apps_validate_rollback_request(app_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -857,7 +860,7 @@ def build_apps_validate_rollback_request(app_id: str, **kwargs: Any) -> HttpRequ "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -880,7 +883,7 @@ def build_apps_commit_rollback_request(app_id: str, **kwargs: Any) -> HttpReques "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -899,7 +902,7 @@ def build_apps_revert_rollback_request(app_id: str, **kwargs: Any) -> HttpReques "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -907,7 +910,7 @@ def build_apps_revert_rollback_request(app_id: str, **kwargs: Any) -> HttpReques return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_apps_get_metrics_bandwidth_daily_request( +def build_apps_get_metrics_bandwidth_daily_request( # pylint: disable=name-too-long app_id: str, *, date: Optional[datetime.datetime] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -921,7 +924,7 @@ def build_apps_get_metrics_bandwidth_daily_request( "app_id": _SERIALIZER.url("app_id", app_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if date is not None: @@ -935,12 +938,14 @@ def build_apps_get_metrics_bandwidth_daily_request( ) -def build_apps_list_metrics_bandwidth_daily_request(**kwargs: Any) -> HttpRequest: +def build_apps_list_metrics_bandwidth_daily_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -986,9 +991,9 @@ def build_cdn_list_endpoints_request( def build_cdn_create_endpoint_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1015,7 +1020,7 @@ def build_cdn_get_endpoint_request(cdn_id: str, **kwargs: Any) -> HttpRequest: "cdn_id": _SERIALIZER.url("cdn_id", cdn_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1026,9 +1031,9 @@ def build_cdn_get_endpoint_request(cdn_id: str, **kwargs: Any) -> HttpRequest: def build_cdn_update_endpoints_request(cdn_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1037,7 +1042,7 @@ def build_cdn_update_endpoints_request(cdn_id: str, **kwargs: Any) -> HttpReques "cdn_id": _SERIALIZER.url("cdn_id", cdn_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1060,7 +1065,7 @@ def build_cdn_delete_endpoint_request(cdn_id: str, **kwargs: Any) -> HttpRequest "cdn_id": _SERIALIZER.url("cdn_id", cdn_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1071,9 +1076,9 @@ def build_cdn_delete_endpoint_request(cdn_id: str, **kwargs: Any) -> HttpRequest def build_cdn_purge_cache_request(cdn_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1082,7 +1087,7 @@ def build_cdn_purge_cache_request(cdn_id: str, **kwargs: Any) -> HttpRequest: "cdn_id": _SERIALIZER.url("cdn_id", cdn_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1126,9 +1131,9 @@ def build_certificates_list_request( def build_certificates_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1155,7 +1160,7 @@ def build_certificates_get_request(certificate_id: str, **kwargs: Any) -> HttpRe "certificate_id": _SERIALIZER.url("certificate_id", certificate_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1176,7 +1181,7 @@ def build_certificates_delete_request( "certificate_id": _SERIALIZER.url("certificate_id", certificate_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1250,7 +1255,7 @@ def build_invoices_get_by_uuid_request(invoice_uuid: str, **kwargs: Any) -> Http "invoice_uuid": _SERIALIZER.url("invoice_uuid", invoice_uuid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1271,7 +1276,7 @@ def build_invoices_get_csv_by_uuid_request( "invoice_uuid": _SERIALIZER.url("invoice_uuid", invoice_uuid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1292,7 +1297,7 @@ def build_invoices_get_pdf_by_uuid_request( "invoice_uuid": _SERIALIZER.url("invoice_uuid", invoice_uuid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1300,7 +1305,7 @@ def build_invoices_get_pdf_by_uuid_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_invoices_get_summary_by_uuid_request( +def build_invoices_get_summary_by_uuid_request( # pylint: disable=name-too-long invoice_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1313,7 +1318,7 @@ def build_invoices_get_summary_by_uuid_request( "invoice_uuid": _SERIALIZER.url("invoice_uuid", invoice_uuid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1361,9 +1366,9 @@ def build_databases_list_clusters_request( def build_databases_create_cluster_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1394,7 +1399,7 @@ def build_databases_get_cluster_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1417,7 +1422,7 @@ def build_databases_destroy_cluster_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1440,7 +1445,7 @@ def build_databases_get_config_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1453,9 +1458,9 @@ def build_databases_patch_config_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1466,7 +1471,7 @@ def build_databases_patch_config_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1493,7 +1498,7 @@ def build_databases_get_ca_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1501,7 +1506,7 @@ def build_databases_get_ca_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_get_migration_status_request( +def build_databases_get_migration_status_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1516,7 +1521,7 @@ def build_databases_get_migration_status_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1524,14 +1529,14 @@ def build_databases_get_migration_status_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_update_online_migration_request( +def build_databases_update_online_migration_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1542,7 +1547,7 @@ def build_databases_update_online_migration_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1554,7 +1559,7 @@ def build_databases_update_online_migration_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_databases_delete_online_migration_request( +def build_databases_delete_online_migration_request( # pylint: disable=name-too-long database_cluster_uuid: str, migration_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1570,7 +1575,7 @@ def build_databases_delete_online_migration_request( "migration_id": _SERIALIZER.url("migration_id", migration_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1583,9 +1588,9 @@ def build_databases_update_region_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1596,7 +1601,7 @@ def build_databases_update_region_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1608,14 +1613,14 @@ def build_databases_update_region_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_databases_update_cluster_size_request( +def build_databases_update_cluster_size_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1626,7 +1631,7 @@ def build_databases_update_cluster_size_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1638,7 +1643,7 @@ def build_databases_update_cluster_size_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_databases_list_firewall_rules_request( +def build_databases_list_firewall_rules_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1653,7 +1658,7 @@ def build_databases_list_firewall_rules_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1661,14 +1666,14 @@ def build_databases_list_firewall_rules_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_update_firewall_rules_request( +def build_databases_update_firewall_rules_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1679,7 +1684,7 @@ def build_databases_update_firewall_rules_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1691,14 +1696,14 @@ def build_databases_update_firewall_rules_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_databases_update_maintenance_window_request( +def build_databases_update_maintenance_window_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1709,7 +1714,7 @@ def build_databases_update_maintenance_window_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1736,7 +1741,7 @@ def build_databases_list_backups_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1759,7 +1764,7 @@ def build_databases_list_replicas_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1772,9 +1777,9 @@ def build_databases_create_replica_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1785,7 +1790,7 @@ def build_databases_create_replica_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1812,7 +1817,7 @@ def build_databases_list_events_logs_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1836,7 +1841,7 @@ def build_databases_get_replica_request( "replica_name": _SERIALIZER.url("replica_name", replica_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1860,7 +1865,7 @@ def build_databases_destroy_replica_request( "replica_name": _SERIALIZER.url("replica_name", replica_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1884,7 +1889,7 @@ def build_databases_promote_replica_request( "replica_name": _SERIALIZER.url("replica_name", replica_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1907,7 +1912,7 @@ def build_databases_list_users_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1920,9 +1925,9 @@ def build_databases_add_user_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1933,7 +1938,7 @@ def build_databases_add_user_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -1961,7 +1966,7 @@ def build_databases_get_user_request( "username": _SERIALIZER.url("username", username, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1985,7 +1990,7 @@ def build_databases_delete_user_request( "username": _SERIALIZER.url("username", username, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1998,9 +2003,9 @@ def build_databases_update_user_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2012,7 +2017,7 @@ def build_databases_update_user_request( "username": _SERIALIZER.url("username", username, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2029,9 +2034,9 @@ def build_databases_reset_auth_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2043,7 +2048,7 @@ def build_databases_reset_auth_request( "username": _SERIALIZER.url("username", username, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2070,7 +2075,7 @@ def build_databases_list_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2083,9 +2088,9 @@ def build_databases_add_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2096,7 +2101,7 @@ def build_databases_add_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2124,7 +2129,7 @@ def build_databases_get_request( "database_name": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2148,7 +2153,7 @@ def build_databases_delete_request( "database_name": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2156,7 +2161,7 @@ def build_databases_delete_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_databases_list_connection_pools_request( +def build_databases_list_connection_pools_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2171,7 +2176,7 @@ def build_databases_list_connection_pools_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2179,14 +2184,14 @@ def build_databases_list_connection_pools_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_add_connection_pool_request( +def build_databases_add_connection_pool_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2197,7 +2202,7 @@ def build_databases_add_connection_pool_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2209,7 +2214,7 @@ def build_databases_add_connection_pool_request( return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_databases_get_connection_pool_request( +def build_databases_get_connection_pool_request( # pylint: disable=name-too-long database_cluster_uuid: str, pool_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2225,7 +2230,7 @@ def build_databases_get_connection_pool_request( "pool_name": _SERIALIZER.url("pool_name", pool_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2233,14 +2238,14 @@ def build_databases_get_connection_pool_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_update_connection_pool_request( +def build_databases_update_connection_pool_request( # pylint: disable=name-too-long database_cluster_uuid: str, pool_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2252,7 +2257,7 @@ def build_databases_update_connection_pool_request( "pool_name": _SERIALIZER.url("pool_name", pool_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2264,7 +2269,7 @@ def build_databases_update_connection_pool_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_databases_delete_connection_pool_request( +def build_databases_delete_connection_pool_request( # pylint: disable=name-too-long database_cluster_uuid: str, pool_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2280,7 +2285,7 @@ def build_databases_delete_connection_pool_request( "pool_name": _SERIALIZER.url("pool_name", pool_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2288,7 +2293,7 @@ def build_databases_delete_connection_pool_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_databases_get_eviction_policy_request( +def build_databases_get_eviction_policy_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2303,7 +2308,7 @@ def build_databases_get_eviction_policy_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2311,14 +2316,14 @@ def build_databases_get_eviction_policy_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_update_eviction_policy_request( +def build_databases_update_eviction_policy_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2329,7 +2334,7 @@ def build_databases_update_eviction_policy_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2356,7 +2361,7 @@ def build_databases_get_sql_mode_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2369,9 +2374,9 @@ def build_databases_update_sql_mode_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2382,7 +2387,7 @@ def build_databases_update_sql_mode_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2394,14 +2399,14 @@ def build_databases_update_sql_mode_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_databases_update_major_version_request( +def build_databases_update_major_version_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2412,7 +2417,7 @@ def build_databases_update_major_version_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2424,7 +2429,7 @@ def build_databases_update_major_version_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_databases_list_kafka_topics_request( +def build_databases_list_kafka_topics_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2439,7 +2444,7 @@ def build_databases_list_kafka_topics_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2447,14 +2452,14 @@ def build_databases_list_kafka_topics_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_create_kafka_topic_request( +def build_databases_create_kafka_topic_request( # pylint: disable=name-too-long database_cluster_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2465,7 +2470,7 @@ def build_databases_create_kafka_topic_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2493,7 +2498,7 @@ def build_databases_get_kafka_topic_request( "topic_name": _SERIALIZER.url("topic_name", topic_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2501,14 +2506,14 @@ def build_databases_get_kafka_topic_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_update_kafka_topic_request( +def build_databases_update_kafka_topic_request( # pylint: disable=name-too-long database_cluster_uuid: str, topic_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2520,7 +2525,7 @@ def build_databases_update_kafka_topic_request( "topic_name": _SERIALIZER.url("topic_name", topic_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2532,7 +2537,7 @@ def build_databases_update_kafka_topic_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_databases_delete_kafka_topic_request( +def build_databases_delete_kafka_topic_request( # pylint: disable=name-too-long database_cluster_uuid: str, topic_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2548,7 +2553,7 @@ def build_databases_delete_kafka_topic_request( "topic_name": _SERIALIZER.url("topic_name", topic_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2556,7 +2561,7 @@ def build_databases_delete_kafka_topic_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_databases_get_cluster_metrics_credentials_request( +def build_databases_get_cluster_metrics_credentials_request( # pylint: disable=name-too-long **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2572,14 +2577,14 @@ def build_databases_get_cluster_metrics_credentials_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_databases_update_cluster_metrics_credentials_request( +def build_databases_update_cluster_metrics_credentials_request( # pylint: disable=name-too-long **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2625,9 +2630,9 @@ def build_domains_list_request( def build_domains_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2654,7 +2659,7 @@ def build_domains_get_request(domain_name: str, **kwargs: Any) -> HttpRequest: "domain_name": _SERIALIZER.url("domain_name", domain_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2673,7 +2678,7 @@ def build_domains_delete_request(domain_name: str, **kwargs: Any) -> HttpRequest "domain_name": _SERIALIZER.url("domain_name", domain_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2701,7 +2706,7 @@ def build_domains_list_records_request( "domain_name": _SERIALIZER.url("domain_name", domain_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if name is not None: @@ -2726,9 +2731,9 @@ def build_domains_list_records_request( def build_domains_create_record_request(domain_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2737,7 +2742,7 @@ def build_domains_create_record_request(domain_name: str, **kwargs: Any) -> Http "domain_name": _SERIALIZER.url("domain_name", domain_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2765,7 +2770,7 @@ def build_domains_get_record_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2778,9 +2783,9 @@ def build_domains_patch_record_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2792,7 +2797,7 @@ def build_domains_patch_record_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2809,9 +2814,9 @@ def build_domains_update_record_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2823,7 +2828,7 @@ def build_domains_update_record_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -2851,7 +2856,7 @@ def build_domains_delete_record_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2898,9 +2903,9 @@ def build_droplets_list_request( def build_droplets_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2949,7 +2954,7 @@ def build_droplets_get_request(droplet_id: int, **kwargs: Any) -> HttpRequest: "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2968,7 +2973,7 @@ def build_droplets_destroy_request(droplet_id: int, **kwargs: Any) -> HttpReques "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2990,7 +2995,7 @@ def build_droplets_list_backups_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -3022,7 +3027,7 @@ def build_droplets_list_snapshots_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -3054,7 +3059,7 @@ def build_droplets_list_kernels_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -3086,7 +3091,7 @@ def build_droplets_list_firewalls_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -3117,7 +3122,7 @@ def build_droplets_list_neighbors_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3125,7 +3130,7 @@ def build_droplets_list_neighbors_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_droplets_list_associated_resources_request( +def build_droplets_list_associated_resources_request( # pylint: disable=name-too-long droplet_id: int, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3138,7 +3143,7 @@ def build_droplets_list_associated_resources_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3146,14 +3151,14 @@ def build_droplets_list_associated_resources_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_droplets_destroy_with_associated_resources_selective_request( +def build_droplets_destroy_with_associated_resources_selective_request( # pylint: disable=name-too-long droplet_id: int, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3162,7 +3167,7 @@ def build_droplets_destroy_with_associated_resources_selective_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3174,7 +3179,7 @@ def build_droplets_destroy_with_associated_resources_selective_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_droplets_destroy_with_associated_resources_dangerous_request( +def build_droplets_destroy_with_associated_resources_dangerous_request( # pylint: disable=name-too-long droplet_id: int, *, x_dangerous: bool, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3187,7 +3192,7 @@ def build_droplets_destroy_with_associated_resources_dangerous_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["X-Dangerous"] = _SERIALIZER.header("x_dangerous", x_dangerous, "bool") @@ -3196,7 +3201,7 @@ def build_droplets_destroy_with_associated_resources_dangerous_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_droplets_get_destroy_associated_resources_status_request( +def build_droplets_get_destroy_associated_resources_status_request( # pylint: disable=name-too-long droplet_id: int, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3209,7 +3214,7 @@ def build_droplets_get_destroy_associated_resources_status_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3217,7 +3222,7 @@ def build_droplets_get_destroy_associated_resources_status_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_droplets_destroy_retry_with_associated_resources_request( +def build_droplets_destroy_retry_with_associated_resources_request( # pylint: disable=name-too-long droplet_id: int, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3230,7 +3235,7 @@ def build_droplets_destroy_retry_with_associated_resources_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3238,7 +3243,9 @@ def build_droplets_destroy_retry_with_associated_resources_request( return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_droplets_list_neighbors_ids_request(**kwargs: Any) -> HttpRequest: +def build_droplets_list_neighbors_ids_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) accept = _headers.pop("Accept", "application/json") @@ -3266,7 +3273,7 @@ def build_droplet_actions_list_request( "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -3287,9 +3294,9 @@ def build_droplet_actions_list_request( def build_droplet_actions_post_request(droplet_id: int, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3298,7 +3305,7 @@ def build_droplet_actions_post_request(droplet_id: int, **kwargs: Any) -> HttpRe "droplet_id": _SERIALIZER.url("droplet_id", droplet_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3310,16 +3317,15 @@ def build_droplet_actions_post_request(droplet_id: int, **kwargs: Any) -> HttpRe return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_droplet_actions_post_by_tag_request(**kwargs: Any) -> HttpRequest: +def build_droplet_actions_post_by_tag_request( # pylint: disable=name-too-long + *, tag_name: Optional[str] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - tag_name = kwargs.pop( - "tag_name", _params.pop("tag_name", None) - ) # type: Optional[str] - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3355,7 +3361,7 @@ def build_droplet_actions_get_request( "action_id": _SERIALIZER.url("action_id", action_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3393,9 +3399,9 @@ def build_firewalls_list_request( def build_firewalls_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3422,7 +3428,7 @@ def build_firewalls_get_request(firewall_id: str, **kwargs: Any) -> HttpRequest: "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3433,9 +3439,9 @@ def build_firewalls_get_request(firewall_id: str, **kwargs: Any) -> HttpRequest: def build_firewalls_update_request(firewall_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3444,7 +3450,7 @@ def build_firewalls_update_request(firewall_id: str, **kwargs: Any) -> HttpReque "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3467,7 +3473,7 @@ def build_firewalls_delete_request(firewall_id: str, **kwargs: Any) -> HttpReque "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3480,9 +3486,9 @@ def build_firewalls_assign_droplets_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3491,7 +3497,7 @@ def build_firewalls_assign_droplets_request( "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3508,9 +3514,9 @@ def build_firewalls_delete_droplets_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3519,7 +3525,7 @@ def build_firewalls_delete_droplets_request( "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3534,9 +3540,9 @@ def build_firewalls_delete_droplets_request( def build_firewalls_add_tags_request(firewall_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3545,7 +3551,7 @@ def build_firewalls_add_tags_request(firewall_id: str, **kwargs: Any) -> HttpReq "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3560,9 +3566,9 @@ def build_firewalls_add_tags_request(firewall_id: str, **kwargs: Any) -> HttpReq def build_firewalls_delete_tags_request(firewall_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3571,7 +3577,7 @@ def build_firewalls_delete_tags_request(firewall_id: str, **kwargs: Any) -> Http "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3586,9 +3592,9 @@ def build_firewalls_delete_tags_request(firewall_id: str, **kwargs: Any) -> Http def build_firewalls_add_rules_request(firewall_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3597,7 +3603,7 @@ def build_firewalls_add_rules_request(firewall_id: str, **kwargs: Any) -> HttpRe "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3614,9 +3620,9 @@ def build_firewalls_delete_rules_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3625,7 +3631,7 @@ def build_firewalls_delete_rules_request( "firewall_id": _SERIALIZER.url("firewall_id", firewall_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3654,9 +3660,9 @@ def build_functions_list_namespaces_request(**kwargs: Any) -> HttpRequest: def build_functions_create_namespace_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3685,7 +3691,7 @@ def build_functions_get_namespace_request( "namespace_id": _SERIALIZER.url("namespace_id", namespace_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3706,7 +3712,7 @@ def build_functions_delete_namespace_request( "namespace_id": _SERIALIZER.url("namespace_id", namespace_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3727,7 +3733,7 @@ def build_functions_list_triggers_request( "namespace_id": _SERIALIZER.url("namespace_id", namespace_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3740,9 +3746,9 @@ def build_functions_create_trigger_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3751,7 +3757,7 @@ def build_functions_create_trigger_request( "namespace_id": _SERIALIZER.url("namespace_id", namespace_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3777,7 +3783,7 @@ def build_functions_get_trigger_request( "trigger_name": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3790,9 +3796,9 @@ def build_functions_update_trigger_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3802,7 +3808,7 @@ def build_functions_update_trigger_request( "trigger_name": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3828,7 +3834,7 @@ def build_functions_delete_trigger_request( "trigger_name": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3878,9 +3884,9 @@ def build_images_list_request( def build_images_create_custom_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3907,7 +3913,7 @@ def build_images_get_request(image_id: JSON, **kwargs: Any) -> HttpRequest: "image_id": _SERIALIZER.url("image_id", image_id, "object"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3918,9 +3924,9 @@ def build_images_get_request(image_id: JSON, **kwargs: Any) -> HttpRequest: def build_images_update_request(image_id: int, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3929,7 +3935,7 @@ def build_images_update_request(image_id: int, **kwargs: Any) -> HttpRequest: "image_id": _SERIALIZER.url("image_id", image_id, "int"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -3952,7 +3958,7 @@ def build_images_delete_request(image_id: int, **kwargs: Any) -> HttpRequest: "image_id": _SERIALIZER.url("image_id", image_id, "int"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3971,7 +3977,7 @@ def build_image_actions_list_request(image_id: int, **kwargs: Any) -> HttpReques "image_id": _SERIALIZER.url("image_id", image_id, "int"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3982,9 +3988,9 @@ def build_image_actions_list_request(image_id: int, **kwargs: Any) -> HttpReques def build_image_actions_post_request(image_id: int, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3993,7 +3999,7 @@ def build_image_actions_post_request(image_id: int, **kwargs: Any) -> HttpReques "image_id": _SERIALIZER.url("image_id", image_id, "int"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4019,7 +4025,7 @@ def build_image_actions_get_request( "action_id": _SERIALIZER.url("action_id", action_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4057,9 +4063,9 @@ def build_kubernetes_list_clusters_request( def build_kubernetes_create_cluster_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4086,7 +4092,7 @@ def build_kubernetes_get_cluster_request(cluster_id: str, **kwargs: Any) -> Http "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4099,9 +4105,9 @@ def build_kubernetes_update_cluster_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4110,7 +4116,7 @@ def build_kubernetes_update_cluster_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4135,7 +4141,7 @@ def build_kubernetes_delete_cluster_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4143,7 +4149,7 @@ def build_kubernetes_delete_cluster_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_kubernetes_list_associated_resources_request( +def build_kubernetes_list_associated_resources_request( # pylint: disable=name-too-long cluster_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4156,7 +4162,7 @@ def build_kubernetes_list_associated_resources_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4164,14 +4170,14 @@ def build_kubernetes_list_associated_resources_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_kubernetes_destroy_associated_resources_selective_request( +def build_kubernetes_destroy_associated_resources_selective_request( # pylint: disable=name-too-long cluster_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4180,7 +4186,7 @@ def build_kubernetes_destroy_associated_resources_selective_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4192,7 +4198,7 @@ def build_kubernetes_destroy_associated_resources_selective_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_kubernetes_destroy_associated_resources_dangerous_request( +def build_kubernetes_destroy_associated_resources_dangerous_request( # pylint: disable=name-too-long cluster_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4205,7 +4211,7 @@ def build_kubernetes_destroy_associated_resources_dangerous_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4227,7 +4233,7 @@ def build_kubernetes_get_kubeconfig_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expiry_seconds is not None: @@ -4257,7 +4263,7 @@ def build_kubernetes_get_credentials_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expiry_seconds is not None: @@ -4273,7 +4279,7 @@ def build_kubernetes_get_credentials_request( ) -def build_kubernetes_get_available_upgrades_request( +def build_kubernetes_get_available_upgrades_request( # pylint: disable=name-too-long cluster_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4286,7 +4292,7 @@ def build_kubernetes_get_available_upgrades_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4299,9 +4305,9 @@ def build_kubernetes_upgrade_cluster_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4310,7 +4316,7 @@ def build_kubernetes_upgrade_cluster_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4335,7 +4341,7 @@ def build_kubernetes_list_node_pools_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4348,9 +4354,9 @@ def build_kubernetes_add_node_pool_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4359,7 +4365,7 @@ def build_kubernetes_add_node_pool_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4385,7 +4391,7 @@ def build_kubernetes_get_node_pool_request( "node_pool_id": _SERIALIZER.url("node_pool_id", node_pool_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4393,14 +4399,14 @@ def build_kubernetes_get_node_pool_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_kubernetes_update_node_pool_request( +def build_kubernetes_update_node_pool_request( # pylint: disable=name-too-long cluster_id: str, node_pool_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4410,7 +4416,7 @@ def build_kubernetes_update_node_pool_request( "node_pool_id": _SERIALIZER.url("node_pool_id", node_pool_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4422,7 +4428,7 @@ def build_kubernetes_update_node_pool_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_kubernetes_delete_node_pool_request( +def build_kubernetes_delete_node_pool_request( # pylint: disable=name-too-long cluster_id: str, node_pool_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4436,7 +4442,7 @@ def build_kubernetes_delete_node_pool_request( "node_pool_id": _SERIALIZER.url("node_pool_id", node_pool_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4468,7 +4474,7 @@ def build_kubernetes_delete_node_request( "node_id": _SERIALIZER.url("node_id", node_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if skip_drain is not None: @@ -4488,14 +4494,14 @@ def build_kubernetes_delete_node_request( ) -def build_kubernetes_recycle_node_pool_request( +def build_kubernetes_recycle_node_pool_request( # pylint: disable=name-too-long cluster_id: str, node_pool_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4505,7 +4511,7 @@ def build_kubernetes_recycle_node_pool_request( "node_pool_id": _SERIALIZER.url("node_pool_id", node_pool_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4517,7 +4523,7 @@ def build_kubernetes_recycle_node_pool_request( return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_kubernetes_get_cluster_user_request( +def build_kubernetes_get_cluster_user_request( # pylint: disable=name-too-long cluster_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4530,7 +4536,7 @@ def build_kubernetes_get_cluster_user_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4552,14 +4558,14 @@ def build_kubernetes_list_options_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_kubernetes_run_cluster_lint_request( +def build_kubernetes_run_cluster_lint_request( # pylint: disable=name-too-long cluster_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4568,7 +4574,7 @@ def build_kubernetes_run_cluster_lint_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4580,7 +4586,7 @@ def build_kubernetes_run_cluster_lint_request( return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_kubernetes_get_cluster_lint_results_request( +def build_kubernetes_get_cluster_lint_results_request( # pylint: disable=name-too-long cluster_id: str, *, run_id: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4594,7 +4600,7 @@ def build_kubernetes_get_cluster_lint_results_request( "cluster_id": _SERIALIZER.url("cluster_id", cluster_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if run_id is not None: @@ -4611,9 +4617,9 @@ def build_kubernetes_get_cluster_lint_results_request( def build_kubernetes_add_registry_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4632,9 +4638,9 @@ def build_kubernetes_add_registry_request(**kwargs: Any) -> HttpRequest: def build_kubernetes_remove_registry_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4653,9 +4659,9 @@ def build_kubernetes_remove_registry_request(**kwargs: Any) -> HttpRequest: def build_load_balancers_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4709,7 +4715,7 @@ def build_load_balancers_get_request(lb_id: str, **kwargs: Any) -> HttpRequest: "lb_id": _SERIALIZER.url("lb_id", lb_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4720,9 +4726,9 @@ def build_load_balancers_get_request(lb_id: str, **kwargs: Any) -> HttpRequest: def build_load_balancers_update_request(lb_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4731,7 +4737,7 @@ def build_load_balancers_update_request(lb_id: str, **kwargs: Any) -> HttpReques "lb_id": _SERIALIZER.url("lb_id", lb_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4754,7 +4760,7 @@ def build_load_balancers_delete_request(lb_id: str, **kwargs: Any) -> HttpReques "lb_id": _SERIALIZER.url("lb_id", lb_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4762,12 +4768,14 @@ def build_load_balancers_delete_request(lb_id: str, **kwargs: Any) -> HttpReques return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_load_balancers_add_droplets_request(lb_id: str, **kwargs: Any) -> HttpRequest: +def build_load_balancers_add_droplets_request( # pylint: disable=name-too-long + lb_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4776,7 +4784,7 @@ def build_load_balancers_add_droplets_request(lb_id: str, **kwargs: Any) -> Http "lb_id": _SERIALIZER.url("lb_id", lb_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4788,14 +4796,14 @@ def build_load_balancers_add_droplets_request(lb_id: str, **kwargs: Any) -> Http return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_load_balancers_remove_droplets_request( +def build_load_balancers_remove_droplets_request( # pylint: disable=name-too-long lb_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4804,7 +4812,7 @@ def build_load_balancers_remove_droplets_request( "lb_id": _SERIALIZER.url("lb_id", lb_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4816,14 +4824,14 @@ def build_load_balancers_remove_droplets_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_load_balancers_add_forwarding_rules_request( +def build_load_balancers_add_forwarding_rules_request( # pylint: disable=name-too-long lb_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4832,7 +4840,7 @@ def build_load_balancers_add_forwarding_rules_request( "lb_id": _SERIALIZER.url("lb_id", lb_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4844,14 +4852,14 @@ def build_load_balancers_add_forwarding_rules_request( return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_load_balancers_remove_forwarding_rules_request( +def build_load_balancers_remove_forwarding_rules_request( # pylint: disable=name-too-long lb_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4860,7 +4868,7 @@ def build_load_balancers_remove_forwarding_rules_request( "lb_id": _SERIALIZER.url("lb_id", lb_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4872,7 +4880,7 @@ def build_load_balancers_remove_forwarding_rules_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_monitoring_list_alert_policy_request( +def build_monitoring_list_alert_policy_request( # pylint: disable=name-too-long *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4899,12 +4907,14 @@ def build_monitoring_list_alert_policy_request( ) -def build_monitoring_create_alert_policy_request(**kwargs: Any) -> HttpRequest: +def build_monitoring_create_alert_policy_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4920,7 +4930,7 @@ def build_monitoring_create_alert_policy_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_monitoring_get_alert_policy_request( +def build_monitoring_get_alert_policy_request( # pylint: disable=name-too-long alert_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4933,7 +4943,7 @@ def build_monitoring_get_alert_policy_request( "alert_uuid": _SERIALIZER.url("alert_uuid", alert_uuid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4941,14 +4951,14 @@ def build_monitoring_get_alert_policy_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_monitoring_update_alert_policy_request( +def build_monitoring_update_alert_policy_request( # pylint: disable=name-too-long alert_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4957,7 +4967,7 @@ def build_monitoring_update_alert_policy_request( "alert_uuid": _SERIALIZER.url("alert_uuid", alert_uuid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -4969,7 +4979,7 @@ def build_monitoring_update_alert_policy_request( return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) -def build_monitoring_delete_alert_policy_request( +def build_monitoring_delete_alert_policy_request( # pylint: disable=name-too-long alert_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4982,7 +4992,7 @@ def build_monitoring_delete_alert_policy_request( "alert_uuid": _SERIALIZER.url("alert_uuid", alert_uuid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4990,7 +5000,7 @@ def build_monitoring_delete_alert_policy_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_monitoring_get_droplet_bandwidth_metrics_request( +def build_monitoring_get_droplet_bandwidth_metrics_request( # pylint: disable=name-too-long *, host_id: str, interface: str, direction: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5016,7 +5026,7 @@ def build_monitoring_get_droplet_bandwidth_metrics_request( ) -def build_monitoring_get_droplet_cpu_metrics_request( +def build_monitoring_get_droplet_cpu_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5040,7 +5050,7 @@ def build_monitoring_get_droplet_cpu_metrics_request( ) -def build_monitoring_get_droplet_filesystem_free_metrics_request( +def build_monitoring_get_droplet_filesystem_free_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5064,7 +5074,7 @@ def build_monitoring_get_droplet_filesystem_free_metrics_request( ) -def build_monitoring_get_droplet_filesystem_size_metrics_request( +def build_monitoring_get_droplet_filesystem_size_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5088,7 +5098,7 @@ def build_monitoring_get_droplet_filesystem_size_metrics_request( ) -def build_monitoring_get_droplet_load1_metrics_request( +def build_monitoring_get_droplet_load1_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5112,7 +5122,7 @@ def build_monitoring_get_droplet_load1_metrics_request( ) -def build_monitoring_get_droplet_load5_metrics_request( +def build_monitoring_get_droplet_load5_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5136,7 +5146,7 @@ def build_monitoring_get_droplet_load5_metrics_request( ) -def build_monitoring_get_droplet_load15_metrics_request( +def build_monitoring_get_droplet_load15_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5160,7 +5170,7 @@ def build_monitoring_get_droplet_load15_metrics_request( ) -def build_monitoring_get_droplet_memory_cached_metrics_request( +def build_monitoring_get_droplet_memory_cached_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5184,7 +5194,7 @@ def build_monitoring_get_droplet_memory_cached_metrics_request( ) -def build_monitoring_get_droplet_memory_free_metrics_request( +def build_monitoring_get_droplet_memory_free_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5208,7 +5218,7 @@ def build_monitoring_get_droplet_memory_free_metrics_request( ) -def build_monitoring_get_droplet_memory_total_metrics_request( +def build_monitoring_get_droplet_memory_total_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5232,7 +5242,7 @@ def build_monitoring_get_droplet_memory_total_metrics_request( ) -def build_monitoring_get_droplet_memory_available_metrics_request( +def build_monitoring_get_droplet_memory_available_metrics_request( # pylint: disable=name-too-long *, host_id: str, start: str, end: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5256,7 +5266,7 @@ def build_monitoring_get_droplet_memory_available_metrics_request( ) -def build_monitoring_get_app_memory_percentage_metrics_request( +def build_monitoring_get_app_memory_percentage_metrics_request( # pylint: disable=name-too-long *, app_id: str, start: str, @@ -5289,7 +5299,7 @@ def build_monitoring_get_app_memory_percentage_metrics_request( ) -def build_monitoring_get_app_cpu_percentage_metrics_request( +def build_monitoring_get_app_cpu_percentage_metrics_request( # pylint: disable=name-too-long *, app_id: str, start: str, @@ -5322,7 +5332,7 @@ def build_monitoring_get_app_cpu_percentage_metrics_request( ) -def build_monitoring_get_app_restart_count_metrics_yml_request( +def build_monitoring_get_app_restart_count_metrics_yml_request( # pylint: disable=name-too-long *, app_id: str, start: str, @@ -5385,9 +5395,9 @@ def build_projects_list_request( def build_projects_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5420,9 +5430,9 @@ def build_projects_get_default_request(**kwargs: Any) -> HttpRequest: def build_projects_update_default_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5441,9 +5451,9 @@ def build_projects_update_default_request(**kwargs: Any) -> HttpRequest: def build_projects_patch_default_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5470,7 +5480,7 @@ def build_projects_get_request(project_id: str, **kwargs: Any) -> HttpRequest: "project_id": _SERIALIZER.url("project_id", project_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -5481,9 +5491,9 @@ def build_projects_get_request(project_id: str, **kwargs: Any) -> HttpRequest: def build_projects_update_request(project_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5492,7 +5502,7 @@ def build_projects_update_request(project_id: str, **kwargs: Any) -> HttpRequest "project_id": _SERIALIZER.url("project_id", project_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -5507,9 +5517,9 @@ def build_projects_update_request(project_id: str, **kwargs: Any) -> HttpRequest def build_projects_patch_request(project_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5518,7 +5528,7 @@ def build_projects_patch_request(project_id: str, **kwargs: Any) -> HttpRequest: "project_id": _SERIALIZER.url("project_id", project_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -5541,7 +5551,7 @@ def build_projects_delete_request(project_id: str, **kwargs: Any) -> HttpRequest "project_id": _SERIALIZER.url("project_id", project_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -5563,7 +5573,7 @@ def build_projects_list_resources_request( "project_id": _SERIALIZER.url("project_id", project_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -5586,9 +5596,9 @@ def build_projects_assign_resources_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5597,7 +5607,7 @@ def build_projects_assign_resources_request( "project_id": _SERIALIZER.url("project_id", project_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -5609,7 +5619,9 @@ def build_projects_assign_resources_request( return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_projects_list_resources_default_request(**kwargs: Any) -> HttpRequest: +def build_projects_list_resources_default_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) accept = _headers.pop("Accept", "application/json") @@ -5623,12 +5635,14 @@ def build_projects_list_resources_default_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_projects_assign_resources_default_request(**kwargs: Any) -> HttpRequest: +def build_projects_assign_resources_default_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5688,9 +5702,9 @@ def build_registry_get_request(**kwargs: Any) -> HttpRequest: def build_registry_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5734,12 +5748,14 @@ def build_registry_get_subscription_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_registry_update_subscription_request(**kwargs: Any) -> HttpRequest: +def build_registry_update_subscription_request( + **kwargs: Any, +) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5755,7 +5771,7 @@ def build_registry_update_subscription_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_registry_get_docker_credentials_request( +def build_registry_get_docker_credentials_request( # pylint: disable=name-too-long *, expiry_seconds: int = 0, read_write: bool = False, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5785,9 +5801,9 @@ def build_registry_get_docker_credentials_request( def build_registry_validate_name_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -5817,7 +5833,7 @@ def build_registry_list_repositories_request( "registry_name": _SERIALIZER.url("registry_name", registry_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -5835,7 +5851,7 @@ def build_registry_list_repositories_request( ) -def build_registry_list_repositories_v2_request( +def build_registry_list_repositories_v2_request( # pylint: disable=name-too-long registry_name: str, *, per_page: int = 20, @@ -5854,7 +5870,7 @@ def build_registry_list_repositories_v2_request( "registry_name": _SERIALIZER.url("registry_name", registry_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -5874,7 +5890,7 @@ def build_registry_list_repositories_v2_request( ) -def build_registry_list_repository_tags_request( +def build_registry_list_repository_tags_request( # pylint: disable=name-too-long registry_name: str, repository_name: str, *, @@ -5894,7 +5910,7 @@ def build_registry_list_repository_tags_request( "repository_name": _SERIALIZER.url("repository_name", repository_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -5912,7 +5928,7 @@ def build_registry_list_repository_tags_request( ) -def build_registry_delete_repository_tag_request( +def build_registry_delete_repository_tag_request( # pylint: disable=name-too-long registry_name: str, repository_name: str, repository_tag: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5927,7 +5943,7 @@ def build_registry_delete_repository_tag_request( "repository_tag": _SERIALIZER.url("repository_tag", repository_tag, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -5935,7 +5951,7 @@ def build_registry_delete_repository_tag_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_registry_list_repository_manifests_request( +def build_registry_list_repository_manifests_request( # pylint: disable=name-too-long registry_name: str, repository_name: str, *, @@ -5955,7 +5971,7 @@ def build_registry_list_repository_manifests_request( "repository_name": _SERIALIZER.url("repository_name", repository_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -5973,7 +5989,7 @@ def build_registry_list_repository_manifests_request( ) -def build_registry_delete_repository_manifest_request( +def build_registry_delete_repository_manifest_request( # pylint: disable=name-too-long registry_name: str, repository_name: str, manifest_digest: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5988,7 +6004,7 @@ def build_registry_delete_repository_manifest_request( "manifest_digest": _SERIALIZER.url("manifest_digest", manifest_digest, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -5996,7 +6012,7 @@ def build_registry_delete_repository_manifest_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_registry_run_garbage_collection_request( +def build_registry_run_garbage_collection_request( # pylint: disable=name-too-long registry_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6009,7 +6025,7 @@ def build_registry_run_garbage_collection_request( "registry_name": _SERIALIZER.url("registry_name", registry_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6017,7 +6033,7 @@ def build_registry_run_garbage_collection_request( return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_registry_get_garbage_collection_request( +def build_registry_get_garbage_collection_request( # pylint: disable=name-too-long registry_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6030,7 +6046,7 @@ def build_registry_get_garbage_collection_request( "registry_name": _SERIALIZER.url("registry_name", registry_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6038,7 +6054,7 @@ def build_registry_get_garbage_collection_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_registry_list_garbage_collections_request( +def build_registry_list_garbage_collections_request( # pylint: disable=name-too-long registry_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6052,7 +6068,7 @@ def build_registry_list_garbage_collections_request( "registry_name": _SERIALIZER.url("registry_name", registry_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -6070,14 +6086,14 @@ def build_registry_list_garbage_collections_request( ) -def build_registry_update_garbage_collection_request( +def build_registry_update_garbage_collection_request( # pylint: disable=name-too-long registry_name: str, garbage_collection_uuid: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6089,7 +6105,7 @@ def build_registry_update_garbage_collection_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -6145,9 +6161,9 @@ def build_reserved_ips_list_request( def build_reserved_ips_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6174,7 +6190,7 @@ def build_reserved_ips_get_request(reserved_ip: str, **kwargs: Any) -> HttpReque "reserved_ip": _SERIALIZER.url("reserved_ip", reserved_ip, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6193,7 +6209,7 @@ def build_reserved_ips_delete_request(reserved_ip: str, **kwargs: Any) -> HttpRe "reserved_ip": _SERIALIZER.url("reserved_ip", reserved_ip, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6214,7 +6230,7 @@ def build_reserved_ips_actions_list_request( "reserved_ip": _SERIALIZER.url("reserved_ip", reserved_ip, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6227,9 +6243,9 @@ def build_reserved_ips_actions_post_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6238,7 +6254,7 @@ def build_reserved_ips_actions_post_request( "reserved_ip": _SERIALIZER.url("reserved_ip", reserved_ip, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -6264,7 +6280,7 @@ def build_reserved_ips_actions_get_request( "action_id": _SERIALIZER.url("action_id", action_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6345,7 +6361,7 @@ def build_snapshots_get_request(snapshot_id: JSON, **kwargs: Any) -> HttpRequest "snapshot_id": _SERIALIZER.url("snapshot_id", snapshot_id, "object"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6364,7 +6380,7 @@ def build_snapshots_delete_request(snapshot_id: JSON, **kwargs: Any) -> HttpRequ "snapshot_id": _SERIALIZER.url("snapshot_id", snapshot_id, "object"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6402,9 +6418,9 @@ def build_tags_list_request( def build_tags_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6433,7 +6449,7 @@ def build_tags_get_request(tag_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6454,7 +6470,7 @@ def build_tags_delete_request(tag_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6465,9 +6481,9 @@ def build_tags_delete_request(tag_id: str, **kwargs: Any) -> HttpRequest: def build_tags_assign_resources_request(tag_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6478,7 +6494,7 @@ def build_tags_assign_resources_request(tag_id: str, **kwargs: Any) -> HttpReque ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -6493,9 +6509,9 @@ def build_tags_assign_resources_request(tag_id: str, **kwargs: Any) -> HttpReque def build_tags_unassign_resources_request(tag_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6506,7 +6522,7 @@ def build_tags_unassign_resources_request(tag_id: str, **kwargs: Any) -> HttpReq ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -6557,9 +6573,9 @@ def build_volumes_list_request( def build_volumes_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6611,7 +6627,7 @@ def build_volumes_get_request(volume_id: str, **kwargs: Any) -> HttpRequest: "volume_id": _SERIALIZER.url("volume_id", volume_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6630,7 +6646,7 @@ def build_volumes_delete_request(volume_id: str, **kwargs: Any) -> HttpRequest: "volume_id": _SERIALIZER.url("volume_id", volume_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6638,15 +6654,15 @@ def build_volumes_delete_request(volume_id: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_volume_actions_post_request(**kwargs: Any) -> HttpRequest: +def build_volume_actions_post_request( + *, per_page: int = 20, page: int = 1, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - per_page = kwargs.pop("per_page", _params.pop("per_page", 20)) # type: int - page = kwargs.pop("page", _params.pop("page", 1)) # type: int - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6686,7 +6702,7 @@ def build_volume_actions_list_request( "volume_id": _SERIALIZER.url("volume_id", volume_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -6705,16 +6721,14 @@ def build_volume_actions_list_request( def build_volume_actions_post_by_id_request( - volume_id: str, **kwargs: Any + volume_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - per_page = kwargs.pop("per_page", _params.pop("per_page", 20)) # type: int - page = kwargs.pop("page", _params.pop("page", 1)) # type: int - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6723,7 +6737,7 @@ def build_volume_actions_post_by_id_request( "volume_id": _SERIALIZER.url("volume_id", volume_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -6760,7 +6774,7 @@ def build_volume_actions_get_request( "action_id": _SERIALIZER.url("action_id", action_id, "int", minimum=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -6791,7 +6805,7 @@ def build_volume_snapshots_get_by_id_request( "snapshot_id": _SERIALIZER.url("snapshot_id", snapshot_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6799,7 +6813,7 @@ def build_volume_snapshots_get_by_id_request( return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) -def build_volume_snapshots_delete_by_id_request( +def build_volume_snapshots_delete_by_id_request( # pylint: disable=name-too-long snapshot_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6812,7 +6826,7 @@ def build_volume_snapshots_delete_by_id_request( "snapshot_id": _SERIALIZER.url("snapshot_id", snapshot_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6834,7 +6848,7 @@ def build_volume_snapshots_list_request( "volume_id": _SERIALIZER.url("volume_id", volume_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -6855,9 +6869,9 @@ def build_volume_snapshots_list_request( def build_volume_snapshots_create_request(volume_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6866,7 +6880,7 @@ def build_volume_snapshots_create_request(volume_id: str, **kwargs: Any) -> Http "volume_id": _SERIALIZER.url("volume_id", volume_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -6908,9 +6922,9 @@ def build_vpcs_list_request( def build_vpcs_create_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6937,7 +6951,7 @@ def build_vpcs_get_request(vpc_id: str, **kwargs: Any) -> HttpRequest: "vpc_id": _SERIALIZER.url("vpc_id", vpc_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6948,9 +6962,9 @@ def build_vpcs_get_request(vpc_id: str, **kwargs: Any) -> HttpRequest: def build_vpcs_update_request(vpc_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6959,7 +6973,7 @@ def build_vpcs_update_request(vpc_id: str, **kwargs: Any) -> HttpRequest: "vpc_id": _SERIALIZER.url("vpc_id", vpc_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -6974,9 +6988,9 @@ def build_vpcs_update_request(vpc_id: str, **kwargs: Any) -> HttpRequest: def build_vpcs_patch_request(vpc_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -6985,7 +6999,7 @@ def build_vpcs_patch_request(vpc_id: str, **kwargs: Any) -> HttpRequest: "vpc_id": _SERIALIZER.url("vpc_id", vpc_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -7008,7 +7022,7 @@ def build_vpcs_delete_request(vpc_id: str, **kwargs: Any) -> HttpRequest: "vpc_id": _SERIALIZER.url("vpc_id", vpc_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -7035,7 +7049,7 @@ def build_vpcs_list_members_request( "vpc_id": _SERIALIZER.url("vpc_id", vpc_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if resource_type is not None: @@ -7087,9 +7101,9 @@ def build_uptime_list_checks_request( def build_uptime_create_check_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -7116,7 +7130,7 @@ def build_uptime_get_check_request(check_id: str, **kwargs: Any) -> HttpRequest: "check_id": _SERIALIZER.url("check_id", check_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -7127,9 +7141,9 @@ def build_uptime_get_check_request(check_id: str, **kwargs: Any) -> HttpRequest: def build_uptime_update_check_request(check_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -7138,7 +7152,7 @@ def build_uptime_update_check_request(check_id: str, **kwargs: Any) -> HttpReque "check_id": _SERIALIZER.url("check_id", check_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -7161,7 +7175,7 @@ def build_uptime_delete_check_request(check_id: str, **kwargs: Any) -> HttpReque "check_id": _SERIALIZER.url("check_id", check_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -7180,7 +7194,7 @@ def build_uptime_get_check_state_request(check_id: str, **kwargs: Any) -> HttpRe "check_id": _SERIALIZER.url("check_id", check_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -7202,7 +7216,7 @@ def build_uptime_list_alerts_request( "check_id": _SERIALIZER.url("check_id", check_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if per_page is not None: @@ -7223,9 +7237,9 @@ def build_uptime_list_alerts_request( def build_uptime_create_alert_request(check_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -7234,7 +7248,7 @@ def build_uptime_create_alert_request(check_id: str, **kwargs: Any) -> HttpReque "check_id": _SERIALIZER.url("check_id", check_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -7260,7 +7274,7 @@ def build_uptime_get_alert_request( "alert_id": _SERIALIZER.url("alert_id", alert_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -7273,9 +7287,9 @@ def build_uptime_update_alert_request( ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -7285,7 +7299,7 @@ def build_uptime_update_alert_request( "alert_id": _SERIALIZER.url("alert_id", alert_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers if content_type is not None: @@ -7311,7 +7325,7 @@ def build_uptime_delete_alert_request( "alert_id": _SERIALIZER.url("alert_id", alert_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -7374,10 +7388,14 @@ def list(self, *, type: Optional[str] = None, **kwargs: Any) -> JSON: ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -7386,186 +7404,28 @@ def list(self, *, type: Optional[str] = None, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_one_clicks_list_request( + _request = build_one_clicks_list_request( type=type, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response + _request.url = self._client.format_url(_request.url) - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @overload - def install_kubernetes( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Install Kubernetes 1-Click Applications. - - To install a Kubernetes 1-Click application on a cluster, send a POST request to - ``/v2/1-clicks/kubernetes``. The ``addon_slugs`` and ``cluster_uuid`` must be provided as body - parameter in order to specify which 1-Click application(s) to install. To list all available - 1-Click Kubernetes applications, send a request to ``/v2/1-clicks?type=kubernetes``. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "addon_slugs": [ - "str" # An array of 1-Click Application slugs to be installed to the - Kubernetes cluster. Required. - ], - "cluster_uuid": "str" # A unique ID for the Kubernetes cluster to which the - 1-Click Applications will be installed. Required. - } - - # response body for status code(s): 200 - response == { - "message": "str" # Optional. A message about the result of the request. - } - """ - - @overload - def install_kubernetes( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Install Kubernetes 1-Click Applications. - - To install a Kubernetes 1-Click application on a cluster, send a POST request to - ``/v2/1-clicks/kubernetes``. The ``addon_slugs`` and ``cluster_uuid`` must be provided as body - parameter in order to specify which 1-Click application(s) to install. To list all available - 1-Click Kubernetes applications, send a request to ``/v2/1-clicks?type=kubernetes``. - - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "message": "str" # Optional. A message about the result of the request. - } - """ - - @distributed_trace - def install_kubernetes(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Install Kubernetes 1-Click Applications. - - To install a Kubernetes 1-Click application on a cluster, send a POST request to - ``/v2/1-clicks/kubernetes``. The ``addon_slugs`` and ``cluster_uuid`` must be provided as body - parameter in order to specify which 1-Click application(s) to install. To list all available - 1-Click Kubernetes applications, send a request to ``/v2/1-clicks?type=kubernetes``. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "message": "str" # Optional. A message about the result of the request. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_one_clicks_install_kubernetes_request( - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -7585,9 +7445,186 @@ def install_kubernetes(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore + + @overload + def install_kubernetes( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Install Kubernetes 1-Click Applications. + + To install a Kubernetes 1-Click application on a cluster, send a POST request to + ``/v2/1-clicks/kubernetes``. The ``addon_slugs`` and ``cluster_uuid`` must be provided as body + parameter in order to specify which 1-Click application(s) to install. To list all available + 1-Click Kubernetes applications, send a request to ``/v2/1-clicks?type=kubernetes``. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "addon_slugs": [ + "str" # An array of 1-Click Application slugs to be installed to the + Kubernetes cluster. Required. + ], + "cluster_uuid": "str" # A unique ID for the Kubernetes cluster to which the + 1-Click Applications will be installed. Required. + } + + # response body for status code(s): 200 + response == { + "message": "str" # Optional. A message about the result of the request. + } + """ + + @overload + def install_kubernetes( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + """Install Kubernetes 1-Click Applications. + + To install a Kubernetes 1-Click application on a cluster, send a POST request to + ``/v2/1-clicks/kubernetes``. The ``addon_slugs`` and ``cluster_uuid`` must be provided as body + parameter in order to specify which 1-Click application(s) to install. To list all available + 1-Click Kubernetes applications, send a request to ``/v2/1-clicks?type=kubernetes``. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "message": "str" # Optional. A message about the result of the request. + } + """ + + @distributed_trace + def install_kubernetes(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Install Kubernetes 1-Click Applications. + + To install a Kubernetes 1-Click application on a cluster, send a POST request to + ``/v2/1-clicks/kubernetes``. The ``addon_slugs`` and ``cluster_uuid`` must be provided as body + parameter in order to specify which 1-Click application(s) to install. To list all available + 1-Click Kubernetes applications, send a request to ``/v2/1-clicks?type=kubernetes``. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "addon_slugs": [ + "str" # An array of 1-Click Application slugs to be installed to the + Kubernetes cluster. Required. + ], + "cluster_uuid": "str" # A unique ID for the Kubernetes cluster to which the + 1-Click Applications will be installed. Required. + } + + # response body for status code(s): 200 + response == { + "message": "str" # Optional. A message about the result of the request. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_one_clicks_install_kubernetes_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore class AccountOperations: @@ -7611,6 +7648,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def get(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get User Information. To show information about the current user account, send a GET request to ``/v2/account``. @@ -7633,26 +7671,30 @@ def get(self, **kwargs: Any) -> JSON: has verified their account via email. False otherwise. Required. "floating_ip_limit": 0, # The total number of Floating IPs the current user or team may have. Required. - "name": "str", # Optional. The display name for the current user. "status": "active", # Default value is "active". This value is one of "active", "warning" or "locked". Known values are: "active", "warning", and "locked". "status_message": "str", # A human-readable message giving more details about the status of the account. Required. + "uuid": "str", # The unique universal identifier for the current + user. Required. + "name": "str", # Optional. The display name for the current user. "team": { "name": "str", # Optional. The name for the current team. "uuid": "str" # Optional. The unique universal identifier for the current team. - }, - "uuid": "str" # The unique universal identifier for the current - user. Required. + } } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -7661,24 +7703,27 @@ def get(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_account_get_request( + _request = build_account_get_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -7698,9 +7743,9 @@ def get(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class SshKeysOperations: @@ -7724,6 +7769,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All SSH Keys. To list all of the keys in your account, send a GET request to ``/v2/account/keys``. The @@ -7743,33 +7789,37 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "ssh_keys": [ { + "name": "str", # A human-readable display name for this key, + used to easily identify the SSH keys when they are displayed. Required. + "public_key": "str", # The entire public key string that was + uploaded. Embedded into the root user's ``authorized_keys`` file if you + include this key during Droplet creation. Required. "fingerprint": "str", # Optional. A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this + "id": 0 # Optional. A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - "name": "str", # A human-readable display name for this key, - used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was - uploaded. Embedded into the root user's ``authorized_keys`` file if you - include this key during Droplet creation. Required. } ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -7778,26 +7828,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_ssh_keys_list_request( + _request = build_ssh_keys_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -7817,14 +7870,15 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New SSH Key. To add a new SSH public key to your DigitalOcean account, send a POST request to @@ -7845,39 +7899,40 @@ def create( # JSON input template you can fill out and use as your body input. body = { - "fingerprint": "str", # Optional. A unique identifier that differentiates - this key from other keys using a format that SSH recognizes. The fingerprint is - created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. Can be - used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was uploaded. + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that differentiates + this key from other keys using a format that SSH recognizes. The fingerprint is + created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can be used + to embed a specific SSH key into a Droplet. } # response body for status code(s): 201 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } """ @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New SSH Key. To add a new SSH public key to your DigitalOcean account, send a POST request to @@ -7885,7 +7940,7 @@ def create( ``public_key`` attribute to the full public key you are adding. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7899,33 +7954,31 @@ def create( # response body for status code(s): 201 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New SSH Key. To add a new SSH public key to your DigitalOcean account, send a POST request to ``/v2/account/keys``. Set the ``name`` attribute to the name you wish to use and the ``public_key`` attribute to the full public key you are adding. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -7933,26 +7986,44 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A human-readable display name for this key, used to easily + identify the SSH keys when they are displayed. Required. + "public_key": "str", # The entire public key string that was uploaded. + Embedded into the root user's ``authorized_keys`` file if you include this key + during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that differentiates + this key from other keys using a format that SSH recognizes. The fingerprint is + created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can be used + to embed a specific SSH key into a Droplet. + } + # response body for status code(s): 201 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -7961,38 +8032,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_ssh_keys_create_request( + _request = build_ssh_keys_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -8012,12 +8086,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, ssh_key_identifier: JSON, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing SSH Key. To get information about a key, send a GET request to ``/v2/account/keys/$KEY_ID`` or @@ -8037,16 +8112,16 @@ def get(self, ssh_key_identifier: JSON, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } # response body for status code(s): 404 @@ -8061,10 +8136,14 @@ def get(self, ssh_key_identifier: JSON, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -8073,25 +8152,28 @@ def get(self, ssh_key_identifier: JSON, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_ssh_keys_get_request( + _request = build_ssh_keys_get_request( ssh_key_identifier=ssh_key_identifier, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -8128,9 +8210,9 @@ def get(self, ssh_key_identifier: JSON, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update( @@ -8141,6 +8223,7 @@ def update( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update an SSH Key's Name. To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` @@ -8170,16 +8253,16 @@ def update( # response body for status code(s): 200 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } # response body for status code(s): 404 @@ -8199,11 +8282,12 @@ def update( def update( self, ssh_key_identifier: JSON, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update an SSH Key's Name. To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` @@ -8213,7 +8297,7 @@ def update( :param ssh_key_identifier: Either the ID or the fingerprint of an existing SSH key. Required. :type ssh_key_identifier: JSON :param body: Set the ``name`` attribute to the new name you want to use. Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -8227,16 +8311,16 @@ def update( # response body for status code(s): 200 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } # response body for status code(s): 404 @@ -8254,8 +8338,9 @@ def update( @distributed_trace def update( - self, ssh_key_identifier: JSON, body: Union[JSON, IO], **kwargs: Any + self, ssh_key_identifier: JSON, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an SSH Key's Name. To update the name of an SSH key, send a PUT request to either ``/v2/account/keys/$SSH_KEY_ID`` @@ -8264,12 +8349,9 @@ def update( :param ssh_key_identifier: Either the ID or the fingerprint of an existing SSH key. Required. :type ssh_key_identifier: JSON - :param body: Set the ``name`` attribute to the new name you want to use. Is either a model type - or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Set the ``name`` attribute to the new name you want to use. Is either a JSON type + or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -8277,19 +8359,25 @@ def update( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # Optional. A human-readable display name for this key, used + to easily identify the SSH keys when they are displayed. + } + # response body for status code(s): 200 response == { "ssh_key": { - "fingerprint": "str", # Optional. A unique identifier that - differentiates this key from other keys using a format that SSH recognizes. - The fingerprint is created when the key is added to your account. - "id": 0, # Optional. A unique identification number for this key. - Can be used to embed a specific SSH key into a Droplet. "name": "str", # A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. Required. - "public_key": "str" # The entire public key string that was + "public_key": "str", # The entire public key string that was uploaded. Embedded into the root user's ``authorized_keys`` file if you include this key during Droplet creation. Required. + "fingerprint": "str", # Optional. A unique identifier that + differentiates this key from other keys using a format that SSH recognizes. + The fingerprint is created when the key is added to your account. + "id": 0 # Optional. A unique identification number for this key. Can + be used to embed a specific SSH key into a Droplet. } } # response body for status code(s): 404 @@ -8304,10 +8392,14 @@ def update( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -8316,20 +8408,20 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_ssh_keys_update_request( + _request = build_ssh_keys_update_request( ssh_key_identifier=ssh_key_identifier, content_type=content_type, json=_json, @@ -8337,18 +8429,21 @@ def update( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -8385,12 +8480,13 @@ def update( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, ssh_key_identifier: JSON, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an SSH Key. To destroy a public SSH key that you have in your account, send a DELETE request to @@ -8419,10 +8515,14 @@ def delete(self, ssh_key_identifier: JSON, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -8431,25 +8531,28 @@ def delete(self, ssh_key_identifier: JSON, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_ssh_keys_delete_request( + _request = build_ssh_keys_delete_request( ssh_key_identifier=ssh_key_identifier, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -8482,9 +8585,9 @@ def delete(self, ssh_key_identifier: JSON, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class ActionsOperations: @@ -8508,6 +8611,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Actions. This will be the entire list of actions taken on your account, so it will be quite large. As @@ -8527,6 +8631,9 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -8568,16 +8675,17 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -8586,26 +8694,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_actions_list_request( + _request = build_actions_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -8625,12 +8736,13 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, action_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Action. To retrieve a specific action object, send a GET request to ``/v2/actions/$ACTION_ID``. @@ -8695,10 +8807,14 @@ def get(self, action_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -8707,25 +8823,28 @@ def get(self, action_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_actions_get_request( + _request = build_actions_get_request( action_id=action_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -8762,9 +8881,9 @@ def get(self, action_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class AppsOperations: # pylint: disable=too-many-public-methods @@ -8795,6 +8914,7 @@ def list( with_projects: Optional[bool] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Apps. List all apps on your account. Information about the current active deployment as well as any @@ -8816,720 +8936,285 @@ def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "apps": [ { - "active_deployment": { - "cause": "str", # Optional. What caused this - deployment to be created. - "cloned_from": "str", # Optional. The ID of a - previous deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ { - "name": "str", # Optional. The name - of this functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this functions component. + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "domains": [ { - "name": "str", # Optional. The name - of this job. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this job. + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # - Optional. When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of - unsuccessful steps. - "pending_steps": 0, # Optional. Number of - pending steps. - "running_steps": 0, # Optional. Number of - currently running steps. - "steps": [ - { - "component_name": "str", # - Optional. The component name that this step is associated - with. - "ended_at": "2020-02-20 - 00:00:00", # Optional. The end time of this step. - "message_base": "str", # - Optional. The base of a human-readable description of the - step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". - "name": "str", # Optional. - The name of this step. - "reason": { - "code": "str", # - Optional. The error code. - "message": "str" # - Optional. The error message. - }, - "started_at": "2020-02-20 - 00:00:00", # Optional. The start time of this step. - "status": "UNKNOWN", # - Optional. Default value is "UNKNOWN". Known values are: - "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child - steps of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of - successful steps. - "summary_steps": [ - { - "component_name": "str", # - Optional. The component name that this step is associated - with. - "ended_at": "2020-02-20 - 00:00:00", # Optional. The end time of this step. - "message_base": "str", # - Optional. The base of a human-readable description of the - step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". - "name": "str", # Optional. - The name of this step. - "reason": { - "code": "str", # - Optional. The error code. - "message": "str" # - Optional. The error message. - }, - "started_at": "2020-02-20 - 00:00:00", # Optional. The start time of this step. - "status": "UNKNOWN", # - Optional. Default value is "UNKNOWN". Known values are: - "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child - steps of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of - steps. + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". }, - "services": [ + "functions": [ { - "name": "str", # Optional. The name - of this service. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # - Optional. The name of the underlying DigitalOcean DBaaS - cluster. This is required for production databases. For - dev databases, if cluster_name is not set, a new cluster - will be provisioned. - "db_name": "str", # - Optional. The name of the MySQL or PostgreSQL database to - configure. - "db_user": "str", # - Optional. The name of the MySQL or PostgreSQL user to - configure. - "engine": "UNSET", # - Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG: - PostgreSQL"n* REDIS: Redis. Known values are: "UNSET", - "MYSQL", "PG", and "REDIS". - "name": "str", # The name. - Must be unique across all components within the same app. - Required. - "production": bool, # - Optional. Whether this is a production or dev database. - "version": "str" # Optional. - The version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The - hostname for the domain. Required. - "minimum_tls_version": "str", - # Optional. The minimum version of TLS a client - application can use to access resources for the domain. - Must be one of the following values wrapped within - quotations: ``"1.2"`` or ``"1.3"``. Known values are: - "1.2" and "1.3". - "type": "UNSPECIFIED", # - Optional. Default value is "UNSPECIFIED". * DEFAULT: The - default ``.ondigitalocean.app`` domain assigned to this - app"n* PRIMARY: The primary domain for this app that is - displayed as the default in the control panel, used in - bindable environment variables, and any other places that - reference an app's live URL. Only one domain may be set - as primary."n* ALIAS: A non-primary domain. Known values - are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # - Optional. Indicates whether the domain includes all - sub-domains, in addition to the given domain. - "zone": "str" # Optional. - Optional. If the domain uses DigitalOcean DNS and you - would like App"nPlatform to automatically manage it for - you, set this to the name of the"ndomain on your - account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. - Default value is "AUTOASSIGN". The app egress type. Known - values are: "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": - bool, # Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default - value is "UNSPECIFIED_OPERATOR". Known values - are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, - # Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value - is "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", - "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. - } ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". - }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. - Must be unique across all components within the same app. - Required. - "routes": [ + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "path": - "str", # Optional. (Deprecated - Use Ingress - Rules instead). An HTTP path prefix. Paths must - start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - } - ], - "ingress": { - "rules": [ + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "envs": [ { - "component": { - "name": - "str", # The name of the component to route to. - Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive - with ``rewrite``. - "rewrite": - "str" # Optional. An optional field that will - rewrite the path of the component to be what is - specified here. By default, the HTTP request path - will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If you specified the - rewrite to be ``/v1/``"" , requests to - ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": bool, # Optional. Whether - browsers should expose the response to the - client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" - # Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" - # Optional. The set of allowed HTTP methods. - This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" - , ``prefix``"" , or ``regex`` must be - set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" - , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 - syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" - # Optional. The set of HTTP response headers - that browsers are allowed to access. This - configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": - "str" # Optional. An optional duration - specifying how long browsers can cache the - results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": "str" # Prefix-based match. For - example, ``/api`` will match ``/api``"" , - ``/api/``"" , and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": - "str", # Optional. The authority/host to - redirect to. This can be a hostname or IP - address. Note: use ``port`` to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, # Optional. The redirect - code to use. Defaults to ``302``. Supported - values are 300, 301, 302, 303, 304, 307, 308. - "scheme": - "str", # Optional. The scheme to redirect to. - Supported values are ``http`` or ``https``. - Default: ``https``. - "uri": "str" - # Optional. An optional URI path to redirect to. - Note: if this is specified the whole URI of the - original request will be overwritten to this - value, irrespective of the original request URI - being matched. - } + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. - }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. + "logtail": { + "token": "str" # + Optional. Logtail token. }, - "instance_count": 1, # - Optional. Default value is 1. The amount of instances - that this component should be scaled to. Default: 1. Must - not be set if autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", - "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", - "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", - "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", - "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # - Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: - Default job type, will auto-complete to POST_DEPLOY - kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs - after an app deployment."n* FAILED_DEPLOY: Indicates a - job that runs after a component fails to deploy. Known - values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", - and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "run_command": "str", # - Optional. An optional run command to override the - component's default. - "source_dir": "str", # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The number of - seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate - shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } - } - ], - "name": "str", # The name of the app. Must - be unique across all apps in the same account. Required. - "region": "str", # Optional. The slug form - of the geographical origin of the app. Default: ``nearest - available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", - "blr", "tor", "lon", and "syd". - "services": [ + }, + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. }, - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the @@ -9576,757 +9261,909 @@ def list( request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. }, - "health_check": { - "failure_threshold": - 0, # Optional. The number of failed health checks - before considered unhealthy. - "http_path": "str", - # Optional. The route path used for the HTTP health - check ping. If not set, the HTTP health check will be - disabled and a TCP health check used instead. - "initial_delay_seconds": 0, # Optional. The number - of seconds to wait before beginning health checks. - "period_seconds": 0, - # Optional. The number of seconds to wait between - health checks. + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. "port": 0, # - Optional. The port on which the health check will be - performed. If not set, the health check will be - performed on the component's http_port. - "success_threshold": - 0, # Optional. The number of successful health - checks before considered healthy. - "timeout_seconds": 0 - # Optional. The number of seconds after which the - check times out. + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "http_port": 0, # Optional. - The internal port on which this service's run command - will listen. Default: 8080"nIf there is not an - environment variable with the name ``PORT``"" , one will - be automatically added with its value set to the value of - this field. - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. - }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "instance_count": 1, # - Optional. Default value is 1. The amount of instances - that this component should be scaled to. Default: 1. Must - not be set if autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", - "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", - "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", - "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", - "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The - ports on which this service will listen for internal - traffic. - ], - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "routes": [ - { - "path": - "str", # Optional. (Deprecated - Use Ingress - Rules instead). An HTTP path prefix. Paths must - start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "run_command": "str", # - Optional. An optional run command to override the - component's default. - "source_dir": "str", # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - "termination": { - "drain_seconds": 0, - # Optional. The number of seconds to wait between - selecting a container instance for termination and - issuing the TERM signal. Selecting a container - instance for termination begins an asynchronous drain - of new requests on upstream load-balancers. (Default - 15). - "grace_period_seconds": 0 # Optional. The number of - seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate - shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "static_sites": [ - { - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "catchall_document": "str", - # Optional. The name of the document to use as the - fallback for any requests to documents that are not found - when serving this static site. Only 1 of - ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "error_document": "404.html", - # Optional. Default value is "404.html". The name of the - error document to use when serving this static site. - Default: 404.html. If no such file exists within the - built assets, App Platform will supply one. - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. + }, + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. - }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. + "logtail": { + "token": "str" # + Optional. Logtail token. }, - "index_document": - "index.html", # Optional. Default value is "index.html". - The name of the index document to use when serving this - static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "output_dir": "str", # - Optional. An optional path to where the built assets will - be located, relative to the build context. If not set, - App Platform will automatically scan for these directory - names: ``_static``"" , ``dist``"" , ``public``"" , - ``build``. - "routes": [ - { - "path": - "str", # Optional. (Deprecated - Use Ingress - Rules instead). An HTTP path prefix. Paths must - start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # Optional. An - optional flag to preserve the path that is - forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left - when forwarded to the component. For example, a - component with ``path=/api`` will have requests - to ``/api/list`` trimmed to ``/list``. If this - value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "run_command": "str", # - Optional. An optional run command to override the - component's default. - "source_dir": "str" # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": - 0, # Optional. The maximum amount of instances for - this component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. Default value is - 80. The average target CPU utilization for - the component. - } - }, - "min_instance_count": - 0 # Optional. The minimum amount of instances for - this component. Must be less than max_instance_count. - }, - "build_command": "str", # - Optional. An optional build command to run while building - this component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root - of the repo. If set, it will be used to build this - component. Otherwise, App Platform will attempt to build - it using buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", - # The variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value - is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* - RUN_AND_BUILD_TIME: Made available at both build - and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and - "RUN_AND_BUILD_TIME". - "type": - "GENERAL", # Optional. Default value is - "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". - "value": - "str" # Optional. The value. If the type is - ``SECRET``"" , the value will be encrypted on - first submission. On following submissions, the - encrypted value should be used. + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # - Optional. The name of the branch to use. - "repo_clone_url": - "str" # Optional. The clone URL of the repo. - Example: - ``https://github.com/digitalocean/sample-golang.git``. + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "github": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "gitlab": { - "branch": "str", # - Optional. The name of the branch to use. - "deploy_on_push": - bool, # Optional. Whether to automatically deploy - new commits made to the repo. - "repo": "str" # - Optional. The name of the repo in the format - owner/repo. Example: ``digitalocean/sample-golang``. + "logtail": { + "token": "str" # + Optional. Logtail token. }, - "image": { - "deploy_on_push": { - "enabled": - bool # Optional. Whether to automatically deploy - new images. Can only be used for images hosted in - DOCR and can only be used with an image tag, not - a specific digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. }, - "digest": "str", # - Optional. The image digest. Cannot be specified if - tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for - the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. The - credentials to be able to pull the image. The value - will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. - "registry_type": - "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", - # Optional. The repository name. - "tag": "latest" # - Optional. Default value is "latest". The repository - tag. Defaults to ``latest`` if not provided and no - digest is provided. Cannot be specified if digest is - provided. + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". }, - "instance_count": 1, # - Optional. Default value is 1. The amount of instances - that this component should be scaled to. Default: 1. Must - not be set if autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", - "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", - "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", - "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", - "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": - "str", # Datadog API key. Required. - "endpoint": - "str" # Optional. Datadog HTTP log intake - endpoint. - }, - "logtail": { - "token": - "str" # Optional. Logtail token. - }, - "name": "str", # - Required. - "open_search": { - "basic_auth": - { - "password": "str", # Password for user - defined in User. Required. - "user": "str" # Username to authenticate - with. Required. - }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. - "index_name": - "logs" # Optional. Default value is "logs". The - index name to use for the logs. If not set, the - default index name is "logs". - }, - "papertrail": { - "endpoint": - "str" # Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. - The name. Must be unique across all components within the - same app. - "run_command": "str", # - Optional. An optional run command to override the - component's default. - "source_dir": "str", # - Optional. An optional path to the working directory to - use for the build. For Dockerfile builds, this will be - used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The number of - seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate - shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name - of this static site. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this static site. + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. } ], - "tier_slug": "str", # Optional. The current pricing - tier slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment was last updated. "workers": [ { - "name": "str", # Optional. The name - of this worker. - "source_commit_hash": "str" # - Optional. The commit hash of the repository that was used to - build this worker. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the - dedicated egress IP. - "ip": "str", # Optional. The IP address of - the dedicated egress IP. - "status": "UNKNOWN" # Optional. Default - value is "UNKNOWN". The status of the dedicated egress IP. Known - values are: "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname - on which the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 - 00:00:00", # Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the - domain. - "phase": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "CONFIGURING", "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of - the domain's progress. - ] - }, - "rotate_validation_records": bool, # - Optional. Validation values have changed and require manual - intervention. - "spec": { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # - Optional. TXT record name. - "txt_value": "str" # - Optional. TXT record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { + "active_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a @@ -10377,8 +10214,8 @@ def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -10410,8 +10247,8 @@ def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -10444,8 +10281,13 @@ def list( } ], "spec": { + "name": "str", # The name of the app. Must + be unique across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For @@ -10458,12 +10300,9 @@ def list( Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # - Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG: - PostgreSQL"n* REDIS: Redis. Known values are: "UNSET", + Optional. Default value is "UNSET". * MYSQL: MySQL * PG: + PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. @@ -10483,21 +10322,21 @@ def list( "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain assigned to this - app"n* PRIMARY: The primary domain for this app that is + app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set - as primary."n* ALIAS: A non-primary domain. Known values + as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain uses DigitalOcean DNS and you - would like App"nPlatform to automatically manage it for - you, set this to the name of the"ndomain on your - account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + would like App Platform to automatically manage it for + you, set this to the name of the domain on your account. + For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -10507,6 +10346,9 @@ def list( }, "functions": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "alerts": [ { "disabled": @@ -10591,8 +10433,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -10600,9 +10442,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -10639,6 +10481,8 @@ def list( owner/repo. Example: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -10650,9 +10494,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -10660,10 +10506,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -10674,9 +10516,6 @@ def list( "str" # Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "routes": [ { "path": @@ -10851,8 +10690,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -10860,9 +10699,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -10915,16 +10754,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -10950,14 +10789,16 @@ def list( "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: - Default job type, will auto-complete to POST_DEPLOY - kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs - after an app deployment."n* FAILED_DEPLOY: Indicates a - job that runs after a component fails to deploy. Known - values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", - and "FAILED_DEPLOY". + Default job type, will auto-complete to POST_DEPLOY kind. + * PRE_DEPLOY: Indicates a job that runs before an app + deployment. * POST_DEPLOY: Indicates a job that runs + after an app deployment. * FAILED_DEPLOY: Indicates a job + that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -10969,9 +10810,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -10979,10 +10822,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -11012,8 +10851,6 @@ def list( } } ], - "name": "str", # The name of the app. Must - be unique across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", @@ -11101,8 +10938,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -11110,9 +10947,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -11174,9 +11011,9 @@ def list( }, "http_port": 0, # Optional. The internal port on which this service's run command - will listen. Default: 8080"nIf there is not an - environment variable with the name ``PORT``"" , one will - be automatically added with its value set to the value of + will listen. Default: 8080 If there is not an environment + variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. "image": { "deploy_on_push": { @@ -11195,16 +11032,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -11234,6 +11071,8 @@ def list( traffic. ], "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -11245,9 +11084,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -11255,10 +11096,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -11386,8 +11223,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -11395,9 +11232,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -11455,16 +11292,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -11478,6 +11315,8 @@ def list( The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -11489,9 +11328,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -11499,10 +11340,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -11587,8 +11424,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -11596,9 +11433,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -11651,16 +11488,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -11685,6 +11522,8 @@ def list( "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -11696,9 +11535,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -11706,10 +11547,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -11763,16 +11600,78 @@ def list( } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # - Optional. The creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the - app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the - app, the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to - which the application belongs. - "pending_deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the + dedicated egress IP. + "ip": "str", # Optional. The IP address of + the dedicated egress IP. + "status": "UNKNOWN" # Optional. Default + value is "UNKNOWN". The status of the dedicated egress IP. Known + values are: "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname + on which the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 + 00:00:00", # Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the + domain. + "phase": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "CONFIGURING", "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of + the domain's progress. + ] + }, + "rotate_validation_records": bool, # + Optional. Validation values have changed and require manual + intervention. + "spec": { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # + Optional. TXT record name. + "txt_value": "str" # + Optional. TXT record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a @@ -11823,8 +11722,8 @@ def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -11856,8 +11755,8 @@ def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -11890,8 +11789,13 @@ def list( } ], "spec": { + "name": "str", # The name of the app. Must + be unique across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For @@ -11904,12 +11808,9 @@ def list( Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # - Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG: - PostgreSQL"n* REDIS: Redis. Known values are: "UNSET", + Optional. Default value is "UNSET". * MYSQL: MySQL * PG: + PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. @@ -11929,21 +11830,21 @@ def list( "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain assigned to this - app"n* PRIMARY: The primary domain for this app that is + app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set - as primary."n* ALIAS: A non-primary domain. Known values + as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain uses DigitalOcean DNS and you - would like App"nPlatform to automatically manage it for - you, set this to the name of the"ndomain on your - account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + would like App Platform to automatically manage it for + you, set this to the name of the domain on your account. + For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -11953,6 +11854,9 @@ def list( }, "functions": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "alerts": [ { "disabled": @@ -12037,8 +11941,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -12046,9 +11950,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -12085,6 +11989,8 @@ def list( owner/repo. Example: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -12096,9 +12002,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -12106,10 +12014,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -12120,9 +12024,6 @@ def list( "str" # Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "routes": [ { "path": @@ -12297,8 +12198,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -12306,9 +12207,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -12361,16 +12262,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -12396,14 +12297,16 @@ def list( "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: - Default job type, will auto-complete to POST_DEPLOY - kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs - after an app deployment."n* FAILED_DEPLOY: Indicates a - job that runs after a component fails to deploy. Known - values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", - and "FAILED_DEPLOY". + Default job type, will auto-complete to POST_DEPLOY kind. + * PRE_DEPLOY: Indicates a job that runs before an app + deployment. * POST_DEPLOY: Indicates a job that runs + after an app deployment. * FAILED_DEPLOY: Indicates a job + that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -12415,9 +12318,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -12425,10 +12330,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -12458,8 +12359,6 @@ def list( } } ], - "name": "str", # The name of the app. Must - be unique across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", @@ -12547,8 +12446,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -12556,9 +12455,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -12620,9 +12519,9 @@ def list( }, "http_port": 0, # Optional. The internal port on which this service's run command - will listen. Default: 8080"nIf there is not an - environment variable with the name ``PORT``"" , one will - be automatically added with its value set to the value of + will listen. Default: 8080 If there is not an environment + variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. "image": { "deploy_on_push": { @@ -12641,16 +12540,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -12680,6 +12579,8 @@ def list( traffic. ], "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -12691,9 +12592,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -12701,10 +12604,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -12832,8 +12731,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -12841,9 +12740,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -12901,16 +12800,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -12924,6 +12823,8 @@ def list( The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -12935,9 +12836,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -12945,10 +12848,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -13033,8 +12932,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -13042,9 +12941,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -13097,16 +12996,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -13131,6 +13030,8 @@ def list( "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -13142,9 +13043,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -13152,10 +13055,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -13209,7 +13108,16 @@ def list( } ] }, - "pinned_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # + Optional. The creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the + app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the + app, the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to + which the application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a @@ -13260,8 +13168,8 @@ def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -13293,8 +13201,8 @@ def list( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for - presentation. For example:"n"n``message_base`` = - "Building service""n``component_name`` = "api". + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -13327,8 +13235,13 @@ def list( } ], "spec": { + "name": "str", # The name of the app. Must + be unique across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For @@ -13341,12 +13254,9 @@ def list( Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # - Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG: - PostgreSQL"n* REDIS: Redis. Known values are: "UNSET", + Optional. Default value is "UNSET". * MYSQL: MySQL * PG: + PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. @@ -13366,21 +13276,21 @@ def list( "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain assigned to this - app"n* PRIMARY: The primary domain for this app that is + app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set - as primary."n* ALIAS: A non-primary domain. Known values + as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain uses DigitalOcean DNS and you - would like App"nPlatform to automatically manage it for - you, set this to the name of the"ndomain on your - account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + would like App Platform to automatically manage it for + you, set this to the name of the domain on your account. + For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -13390,6 +13300,9 @@ def list( }, "functions": [ { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. "alerts": [ { "disabled": @@ -13474,8 +13387,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -13483,9 +13396,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -13522,6 +13435,8 @@ def list( owner/repo. Example: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -13533,9 +13448,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -13543,10 +13460,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -13557,9 +13470,6 @@ def list( "str" # Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. - Must be unique across all components within the same app. - Required. "routes": [ { "path": @@ -13734,8 +13644,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -13743,9 +13653,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -13798,16 +13708,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -13833,14 +13743,16 @@ def list( "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: - Default job type, will auto-complete to POST_DEPLOY - kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs - after an app deployment."n* FAILED_DEPLOY: Indicates a - job that runs after a component fails to deploy. Known - values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", - and "FAILED_DEPLOY". + Default job type, will auto-complete to POST_DEPLOY kind. + * PRE_DEPLOY: Indicates a job that runs before an app + deployment. * POST_DEPLOY: Indicates a job that runs + after an app deployment. * FAILED_DEPLOY: Indicates a job + that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -13852,9 +13764,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -13862,10 +13776,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -13895,8 +13805,6 @@ def list( } } ], - "name": "str", # The name of the app. Must - be unique across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", @@ -13984,8 +13892,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -13993,9 +13901,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -14057,9 +13965,9 @@ def list( }, "http_port": 0, # Optional. The internal port on which this service's run command - will listen. Default: 8080"nIf there is not an - environment variable with the name ``PORT``"" , one will - be automatically added with its value set to the value of + will listen. Default: 8080 If there is not an environment + variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. "image": { "deploy_on_push": { @@ -14078,16 +13986,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -14117,6 +14025,8 @@ def list( traffic. ], "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -14128,9 +14038,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -14138,10 +14050,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -14269,8 +14177,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -14278,9 +14186,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -14338,16 +14246,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -14361,6 +14269,8 @@ def list( The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -14372,9 +14282,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -14382,10 +14294,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -14470,8 +14378,8 @@ def list( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made - available only at run-time"n* BUILD_TIME: Made - available only at build-time"n* + available only at run-time * BUILD_TIME: Made + available only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and @@ -14479,9 +14387,9 @@ def list( "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text environment - variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" - and "SECRET". + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on @@ -14534,16 +14442,16 @@ def list( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be - used."n"n"n* "$username:$access_token" for registries - of type ``DOCKER_HUB``."n* "$username:$access_token" - for registries of type ``GHCR``. + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub - container registry type."n* DOCR: The DigitalOcean - container registry type."n* GHCR: The Github - container registry type. Known values are: - "DOCKER_HUB", "DOCR", and "GHCR". + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # @@ -14568,6 +14476,8 @@ def list( "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # + Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -14579,9 +14489,11 @@ def list( "token": "str" # Optional. Logtail token. }, - "name": "str", # - Required. "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. "basic_auth": { "password": "str", # Password for user @@ -14589,10 +14501,6 @@ def list( "user": "str" # Username to authenticate with. Required. }, - "endpoint": - "str", # OpenSearch API Endpoint. Only HTTPS is - supported. Format: :code:``::code:``. - Default port is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the @@ -14646,299 +14554,718 @@ def list( } ] }, - "project_id": "str", # Optional. The ID of the project the - app is assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that - this region is in. - "data_centers": [ - "str" # Optional. Data centers that are in - this region. - ], - "default": bool, # Optional. Whether or not the - region is presented as the default. - "disabled": bool, # Optional. Whether or not the - region is open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of - the region. - "reason": "str", # Optional. Reason that this region - is not available. - "slug": "str" # Optional. The slug form of the - region name. - }, - "spec": { - "databases": [ + "pinned_deployment": { + "cause": "str", # Optional. What caused this + deployment to be created. + "cloned_from": "str", # Optional. The ID of a + previous deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. + "name": "str", # Optional. The name + of this functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this functions component. } ], - "domains": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + "name": "str", # Optional. The name + of this job. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this job. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # + Optional. When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of + unsuccessful steps. + "pending_steps": 0, # Optional. Number of + pending steps. + "running_steps": 0, # Optional. Number of + currently running steps. + "steps": [ + { + "component_name": "str", # + Optional. The component name that this step is associated + with. + "ended_at": "2020-02-20 + 00:00:00", # Optional. The end time of this step. + "message_base": "str", # + Optional. The base of a human-readable description of the + step intended to be combined with the component name for + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". + "name": "str", # Optional. + The name of this step. + "reason": { + "code": "str", # + Optional. The error code. + "message": "str" # + Optional. The error message. + }, + "started_at": "2020-02-20 + 00:00:00", # Optional. The start time of this step. + "status": "UNKNOWN", # + Optional. Default value is "UNKNOWN". Known values are: + "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child + steps of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of + successful steps. + "summary_steps": [ + { + "component_name": "str", # + Optional. The component name that this step is associated + with. + "ended_at": "2020-02-20 + 00:00:00", # Optional. The end time of this step. + "message_base": "str", # + Optional. The base of a human-readable description of the + step intended to be combined with the component name for + presentation. For example: ``message_base`` = "Building + service" ``component_name`` = "api". + "name": "str", # Optional. + The name of this step. + "reason": { + "code": "str", # + Optional. The error code. + "message": "str" # + Optional. The error message. + }, + "started_at": "2020-02-20 + 00:00:00", # Optional. The start time of this step. + "status": "UNKNOWN", # + Optional. Default value is "UNKNOWN". Known values are: + "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child + steps of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of + steps. }, - "functions": [ + "services": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. + "name": "str", # Optional. The name + of this service. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must + be unique across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. + "cluster_name": "str", # + Optional. The name of the underlying DigitalOcean DBaaS + cluster. This is required for production databases. For + dev databases, if cluster_name is not set, a new cluster + will be provisioned. + "db_name": "str", # + Optional. The name of the MySQL or PostgreSQL database to + configure. + "db_user": "str", # + Optional. The name of the MySQL or PostgreSQL user to + configure. + "engine": "UNSET", # + Optional. Default value is "UNSET". * MYSQL: MySQL * PG: + PostgreSQL * REDIS: Redis. Known values are: "UNSET", + "MYSQL", "PG", and "REDIS". + "production": bool, # + Optional. Whether this is a production or dev database. + "version": "str" # Optional. + The version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The + hostname for the domain. Required. + "minimum_tls_version": "str", + # Optional. The minimum version of TLS a client + application can use to access resources for the domain. + Must be one of the following values wrapped within + quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # + Optional. Default value is "UNSPECIFIED". * DEFAULT: The + default ``.ondigitalocean.app`` domain assigned to this + app * PRIMARY: The primary domain for this app that is + displayed as the default in the control panel, used in + bindable environment variables, and any other places that + reference an app's live URL. Only one domain may be set + as primary. * ALIAS: A non-primary domain. Known values + are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # + Optional. Indicates whether the domain includes all + sub-domains, in addition to the given domain. + "zone": "str" # Optional. + Optional. If the domain uses DigitalOcean DNS and you + would like App Platform to automatically manage it for + you, set this to the name of the domain on your account. + For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. + Default value is "AUTOASSIGN". The app egress type. Known + values are: "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. + Must be unique across all components within the same app. + Required. + "alerts": [ + { + "disabled": + bool, # Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default + value is "UNSPECIFIED_OPERATOR". Known values + are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, + # Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value + is "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", + "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR". + } ], - "allow_origins": [ + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. } ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. + }, + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": + "str", # Optional. (Deprecated - Use Ingress + Rules instead). An HTTP path prefix. Paths must + start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. + } ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ + "source_dir": "str" # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "component": { + "name": + "str", # The name of the component to route to. + Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive + with ``rewrite``. + "rewrite": + "str" # Optional. An optional field that will + rewrite the path of the component to be what is + specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If you specified the + rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # Optional. Whether + browsers should expose the response to the + client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" + # Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" + # Optional. The set of allowed HTTP methods. + This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" + , ``prefix``"" , or ``regex`` must be + set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" + , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 + syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" + # Optional. The set of HTTP response headers + that browsers are allowed to access. This + configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": + "str" # Optional. An optional duration + specifying how long browsers can cache the + results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # Prefix-based match. For + example, ``/api`` will match ``/api``"" , + ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": + "str", # Optional. The authority/host to + redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, # Optional. The redirect + code to use. Defaults to ``302``. Supported + values are 300, 301, 302, 303, 304, 307, 308. + "scheme": + "str", # Optional. The scheme to redirect to. + Supported values are ``http`` or ``https``. + Default: ``https``. + "uri": "str" + # Optional. An optional URI path to redirect to. + Note: if this is specified the whole URI of the + original request will be overwritten to this + value, irrespective of the original request URI + being matched. + } } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": + 0, # Optional. The maximum amount of instances for + this component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. Default value is + 80. The average target CPU utilization for + the component. + } + }, + "min_instance_count": + 0 # Optional. The minimum amount of instances for + this component. Must be less than max_instance_count. }, - "logtail": { - "token": "str" # - Optional. Logtail token. + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "instance_count": 1, # + Optional. Default value is 1. The amount of instances + that this component should be scaled to. Default: 1. Must + not be set if autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", + "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", + "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", + "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", + "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # + Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: + Default job type, will auto-complete to POST_DEPLOY kind. + * PRE_DEPLOY: Indicates a job that runs before an app + deployment. * POST_DEPLOY: Indicates a job that runs + after an app deployment. * FAILED_DEPLOY: Indicates a job + that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. + }, + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str", # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The number of + seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate + shutdown. (Default 120). } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + } + ], + "region": "str", # Optional. The slug form + of the geographical origin of the app. Default: ``nearest + available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", + "blr", "tor", "lon", and "syd". + "services": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. + "autoscaling": { + "max_instance_count": + 0, # Optional. The maximum amount of instances for + this component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. Default value is + 80. The average target CPU utilization for + the component. + } + }, + "min_instance_count": + 0 # Optional. The minimum amount of instances for + this component. Must be less than max_instance_count. }, + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the @@ -14985,910 +15312,706 @@ def list( request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. } + ], + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": + 0, # Optional. The number of failed health checks + before considered unhealthy. + "http_path": "str", + # Optional. The route path used for the HTTP health + check ping. If not set, the HTTP health check will be + disabled and a TCP health check used instead. + "initial_delay_seconds": 0, # Optional. The number + of seconds to wait before beginning health checks. + "period_seconds": 0, + # Optional. The number of seconds to wait between + health checks. "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + Optional. The port on which the health check will be + performed. If not set, the health check will be + performed on the component's http_port. + "success_threshold": + 0, # Optional. The number of successful health + checks before considered healthy. + "timeout_seconds": 0 + # Optional. The number of seconds after which the + check times out. + }, + "http_port": 0, # Optional. + The internal port on which this service's run command + will listen. Default: 8080 If there is not an environment + variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of + this field. + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. + }, + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. + }, + "instance_count": 1, # + Optional. Default value is 1. The amount of instances + that this component should be scaled to. Default: 1. Must + not be set if autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", + "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", + "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", + "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", + "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The + ports on which this service will listen for internal + traffic. + ], + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. + }, + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "routes": [ + { + "path": + "str", # Optional. (Deprecated - Use Ingress + Rules instead). An HTTP path prefix. Paths must + start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str", # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, + # Optional. The number of seconds to wait between + selecting a container instance for termination and + issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain + of new requests on upstream load-balancers. (Default + 15). + "grace_period_seconds": 0 # Optional. The number of + seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate + shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + } + ], + "static_sites": [ + { + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. + "catchall_document": "str", + # Optional. The name of the document to use as the + fallback for any requests to documents that are not found + when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. + } + ], + "error_document": "404.html", + # Optional. Default value is "404.html". The name of the + error document to use when serving this static site. + Default: 404.html. If no such file exists within the + built assets, App Platform will supply one. + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # - Optional. Logtail token. + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. + "index_document": + "index.html", # Optional. Default value is "index.html". + The name of the index document to use when serving this + static site. Default: index.html. + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. + }, + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "output_dir": "str", # + Optional. An optional path to where the built assets will + be located, relative to the build context. If not set, + App Platform will automatically scan for these directory + names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": + "str", # Optional. (Deprecated - Use Ingress + Rules instead). An HTTP path prefix. Paths must + start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # Optional. An + optional flag to preserve the path that is + forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left + when forwarded to the component. For example, a + component with ``path=/api`` will have requests + to ``/api/list`` trimmed to ``/list``. If this + value is ``true``"" , the path will remain + ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str" # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": + 0, # Optional. The maximum amount of instances for + this component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. Default value is + 80. The average target CPU utilization for + the component. + } + }, + "min_instance_count": + 0 # Optional. The minimum amount of instances for + this component. Must be less than max_instance_count. + }, + "build_command": "str", # + Optional. An optional build command to run while building + this component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root + of the repo. If set, it will be used to build this + component. Otherwise, App Platform will attempt to build + it using buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", + # The variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value + is "RUN_AND_BUILD_TIME". * RUN_TIME: Made + available only at run-time * BUILD_TIME: Made + available only at build-time * + RUN_AND_BUILD_TIME: Made available at both build + and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and + "RUN_AND_BUILD_TIME". + "type": + "GENERAL", # Optional. Default value is + "GENERAL". * GENERAL: A plain-text environment + variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and + "SECRET". + "value": + "str" # Optional. The value. If the type is + ``SECRET``"" , the value will be encrypted on + first submission. On following submissions, the + encrypted value should be used. + } ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "git": { + "branch": "str", # + Optional. The name of the branch to use. + "repo_clone_url": + "str" # Optional. The clone URL of the repo. + Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # - Optional. Logtail token. + "gitlab": { + "branch": "str", # + Optional. The name of the branch to use. + "deploy_on_push": + bool, # Optional. Whether to automatically deploy + new commits made to the repo. + "repo": "str" # + Optional. The name of the repo in the format + owner/repo. Example: ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": + bool # Optional. Whether to automatically deploy + new images. Can only be used for images hosted in + DOCR and can only be used with an image tag, not + a specific digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "digest": "str", # + Optional. The image digest. Cannot be specified if + tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for + the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. The + credentials to be able to pull the image. The value + will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for + registries of type ``GHCR``. + "registry_type": + "str", # Optional. * DOCKER_HUB: The DockerHub + container registry type. * DOCR: The DigitalOcean + container registry type. * GHCR: The Github container + registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", + # Optional. The repository name. + "tag": "latest" # + Optional. Default value is "latest". The repository + tag. Defaults to ``latest`` if not provided and no + digest is provided. Cannot be specified if digest is + provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "instance_count": 1, # + Optional. Default value is 1. The amount of instances + that this component should be scaled to. Default: 1. Must + not be set if autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", + "apps-s-2vcpu-4gb", "apps-d-1vcpu-0.5gb", + "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", + "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", + "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # + Required. + "datadog": { + "api_key": + "str", # Datadog API key. Required. + "endpoint": + "str" # Optional. Datadog HTTP log intake + endpoint. + }, + "logtail": { + "token": + "str" # Optional. Logtail token. + }, + "open_search": { + "endpoint": + "str", # OpenSearch API Endpoint. Only HTTPS is + supported. Format: :code:``::code:``. + Default port is 9300. Required. + "basic_auth": + { + "password": "str", # Password for user + defined in User. Required. + "user": "str" # Username to authenticate + with. Required. + }, + "index_name": + "logs" # Optional. Default value is "logs". The + index name to use for the logs. If not set, the + default index name is "logs". + }, + "papertrail": { + "endpoint": + "str" # Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. + The name. Must be unique across all components within the + same app. + "run_command": "str", # + Optional. An optional run command to override the + component's default. + "source_dir": "str", # + Optional. An optional path to the working directory to + use for the build. For Dockerfile builds, this will be + used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The number of + seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate + shutdown. (Default 120). } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name + of this static site. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this static site. } ], - "static_sites": [ + "tier_slug": "str", # Optional. The current pricing + tier slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment was last updated. + "workers": [ { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } + "name": "str", # Optional. The name + of this worker. + "source_commit_hash": "str" # + Optional. The commit hash of the repository that was used to + build this worker. } ] }, + "project_id": "str", # Optional. The ID of the project the + app is assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that + this region is in. + "data_centers": [ + "str" # Optional. Data centers that are in + this region. + ], + "default": bool, # Optional. Whether or not the + region is presented as the default. + "disabled": bool, # Optional. Whether or not the + region is open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of + the region. + "reason": "str", # Optional. Reason that this region + is not available. + "slug": "str" # Optional. The slug form of the + region name. + }, "tier_slug": "str", # Optional. The current pricing tier slug of the app. "updated_at": "2020-02-20 00:00:00" # Optional. Time of the @@ -15897,16 +16020,17 @@ def list( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -15915,27 +16039,30 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_list_request( + _request = build_apps_list_request( page=page, per_page=per_page, with_projects=with_projects, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -15955,18 +16082,19 @@ def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New App. - Create a new app by submitting an app specification. For documentation on app specifications (\ - ``AppSpec`` objects), please refer to `the product documentation + Create a new app by submitting an app specification. For documentation on app specifications + (\\ ``AppSpec`` objects), please refer to `the product documentation `_. :param body: Required. @@ -15983,11 +16111,13 @@ def create( # JSON input template you can fill out and use as your body input. body = { - "project_id": "str", # Optional. The ID of the project the app should be - assigned to. If omitted, it will be assigned to your default project. "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, @@ -15997,10 +16127,8 @@ def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of the @@ -16018,19 +16146,19 @@ def create( "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that + assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A + live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -16040,6 +16168,8 @@ def create( }, "functions": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "alerts": [ { "disabled": bool, # Optional. Is the @@ -16113,15 +16243,14 @@ def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -16154,6 +16283,7 @@ def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -16164,18 +16294,17 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -16185,8 +16314,6 @@ def create( syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -16338,15 +16465,14 @@ def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -16392,12 +16518,12 @@ def create( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -16420,12 +16546,13 @@ def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -16436,18 +16563,17 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -16473,8 +16599,6 @@ def create( } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -16552,15 +16676,14 @@ def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -16612,7 +16735,7 @@ def create( of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -16629,12 +16752,12 @@ def create( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -16660,6 +16783,7 @@ def create( service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -16670,18 +16794,17 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -16791,15 +16914,14 @@ def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -16849,12 +16971,12 @@ def create( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -16868,6 +16990,7 @@ def create( value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -16878,18 +17001,17 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -16963,15 +17085,14 @@ def create( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -17017,12 +17138,12 @@ def create( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -17044,6 +17165,7 @@ def create( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -17054,18 +17176,17 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -17091,687 +17212,275 @@ def create( } } ] - } + }, + "project_id": "str" # Optional. The ID of the project the app should be + assigned to. If omitted, it will be assigned to your default project. } # response body for status code(s): 200 response == { "app": { - "active_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "domains": [ { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. } ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". }, - "services": [ + "functions": [ { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -17818,712 +17527,852 @@ def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { + "active_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -18572,8 +18421,8 @@ def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -18604,8 +18453,8 @@ def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -18637,8 +18486,12 @@ def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -18648,11 +18501,9 @@ def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -18670,22 +18521,22 @@ def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -18695,6 +18546,8 @@ def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -18779,13 +18632,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -18823,6 +18676,7 @@ def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -18833,8 +18687,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -18842,10 +18699,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -18856,8 +18709,6 @@ def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -19024,13 +18875,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -19084,15 +18935,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -19116,13 +18967,14 @@ def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -19133,8 +18985,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -19142,10 +18997,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -19172,8 +19023,6 @@ def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -19261,13 +19110,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -19331,9 +19180,9 @@ def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -19351,15 +19200,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -19386,6 +19235,7 @@ def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -19396,8 +19246,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -19405,10 +19258,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -19530,13 +19379,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -19595,15 +19444,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -19616,6 +19465,7 @@ def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -19626,8 +19476,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -19635,10 +19488,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -19717,13 +19566,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -19777,15 +19626,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -19808,6 +19657,7 @@ def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -19818,8 +19668,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -19827,10 +19680,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -19880,15 +19729,76 @@ def create( } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -19937,8 +19847,8 @@ def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -19969,8 +19879,8 @@ def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -20002,8 +19912,12 @@ def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -20013,11 +19927,9 @@ def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -20035,22 +19947,22 @@ def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -20060,6 +19972,8 @@ def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -20144,13 +20058,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -20188,6 +20102,7 @@ def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -20198,8 +20113,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -20207,10 +20125,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -20221,8 +20135,6 @@ def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -20389,13 +20301,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -20449,15 +20361,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -20481,13 +20393,14 @@ def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -20498,8 +20411,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -20507,10 +20423,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -20537,8 +20449,6 @@ def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -20626,13 +20536,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -20696,9 +20606,9 @@ def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -20716,15 +20626,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -20751,6 +20661,7 @@ def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -20761,8 +20672,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -20770,10 +20684,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -20895,13 +20805,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -20960,15 +20870,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -20981,6 +20891,7 @@ def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -20991,8 +20902,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -21000,10 +20914,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -21082,13 +20992,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -21142,15 +21052,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -21173,6 +21083,7 @@ def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -21183,8 +21094,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -21192,10 +21106,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -21245,7 +21155,15 @@ def create( } ] }, - "pinned_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -21294,8 +21212,8 @@ def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -21326,8 +21244,8 @@ def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -21359,8 +21277,12 @@ def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -21370,11 +21292,9 @@ def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -21392,22 +21312,22 @@ def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -21417,6 +21337,8 @@ def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -21501,13 +21423,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -21545,6 +21467,7 @@ def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -21555,8 +21478,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -21564,10 +21490,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -21578,8 +21500,6 @@ def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -21746,13 +21666,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -21806,15 +21726,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -21838,13 +21758,14 @@ def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -21855,8 +21776,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -21864,10 +21788,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -21894,8 +21814,6 @@ def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -21983,13 +21901,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -22053,9 +21971,9 @@ def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -22073,15 +21991,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -22108,6 +22026,7 @@ def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -22118,8 +22037,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -22127,10 +22049,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -22252,13 +22170,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -22317,15 +22235,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -22338,6 +22256,7 @@ def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -22348,8 +22267,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -22357,10 +22279,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -22439,13 +22357,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -22499,15 +22417,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -22530,6 +22448,7 @@ def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -22540,8 +22459,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -22549,10 +22471,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -22602,285 +22520,213 @@ def create( } ] }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ + "pinned_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "domains": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. } ], - "ingress": { - "rules": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -22927,1537 +22773,404 @@ def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - """ - - @overload - def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Create a New App. - - Create a new app by submitting an app specification. For documentation on app specifications (\ - ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -24545,13 +23258,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -24615,9 +23328,9 @@ def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -24635,15 +23348,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -24670,6 +23383,7 @@ def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -24680,8 +23394,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -24689,10 +23406,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -24814,13 +23527,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -24879,15 +23592,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -24900,6 +23613,7 @@ def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -24910,8 +23624,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -24919,10 +23636,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -25001,13 +23714,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -25061,15 +23774,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -25092,6 +23805,7 @@ def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -25102,8 +23816,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -25111,10 +23828,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -25164,38 +23877,86 @@ def create( } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + """ + + @overload + def create( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a New App. + + Create a new app by submitting an app specification. For documentation on app specifications + (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { "domain": "str", # The hostname for the domain. Required. "minimum_tls_version": "str", # Optional. @@ -25205,709 +23966,232 @@ def create( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. } ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". }, - "services": [ + "functions": [ { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -25954,229 +24238,1058 @@ def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "active_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] } ], - "static_sites": [ + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -26223,16 +25336,6 @@ def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. "envs": [ { "key": "str", # The @@ -26240,13 +25343,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -26256,11 +25359,6 @@ def create( used. } ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -26288,44 +25386,8 @@ def create( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -26336,8 +25398,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -26345,10 +25410,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -26359,13 +25420,6 @@ def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -26382,660 +25436,93 @@ def create( the path will remain ``/api/list``. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. } ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. } }, "redirect": { @@ -27099,13 +25586,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -27159,15 +25646,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -27191,13 +25678,14 @@ def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -27208,8 +25696,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -27217,10 +25708,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -27247,8 +25734,6 @@ def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -27336,13 +25821,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -27406,9 +25891,9 @@ def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -27426,15 +25911,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -27461,6 +25946,7 @@ def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -27471,8 +25957,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -27480,10 +25969,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -27605,13 +26090,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -27670,15 +26155,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -27691,6 +26176,7 @@ def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -27701,8 +26187,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -27710,10 +26199,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -27792,13 +26277,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -27852,15 +26337,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -27883,6 +26368,7 @@ def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -27893,8 +26379,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -27902,10 +26391,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -27955,7 +26440,76 @@ def create( } ] }, - "pinned_deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -28004,8 +26558,8 @@ def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -28036,8 +26590,8 @@ def create( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -28069,8 +26623,12 @@ def create( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -28080,11 +26638,9 @@ def create( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -28102,22 +26658,22 @@ def create( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -28127,6 +26683,8 @@ def create( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -28211,13 +26769,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -28255,6 +26813,7 @@ def create( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -28265,8 +26824,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -28274,10 +26836,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -28288,8 +26846,6 @@ def create( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -28456,13 +27012,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -28516,15 +27072,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -28548,13 +27104,14 @@ def create( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -28565,8 +27122,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -28574,10 +27134,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -28604,8 +27160,6 @@ def create( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -28693,13 +27247,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -28763,9 +27317,9 @@ def create( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -28783,15 +27337,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -28818,6 +27372,7 @@ def create( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -28828,8 +27383,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -28837,10 +27395,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -28962,13 +27516,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -29027,15 +27581,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -29048,6 +27602,7 @@ def create( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -29058,8 +27613,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -29067,10 +27625,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -29149,13 +27703,13 @@ def create( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -29209,15 +27763,15 @@ def create( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -29240,6 +27794,7 @@ def create( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -29250,8 +27805,11 @@ def create( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -29259,10 +27817,6 @@ def create( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -29312,285 +27866,689 @@ def create( } ] }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "domains": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. }, - "functions": [ + "services": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } ], - "allow_origins": [ + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -29637,885 +28595,643 @@ def create( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. } ] }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - """ - - @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Create a New App. - - Create a new app by submitting an app specification. For documentation on app specifications (\ - ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { + "pinned_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -30564,8 +29280,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -30596,8 +29312,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -30629,8 +29345,12 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -30640,11 +29360,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -30662,22 +29380,22 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -30687,6 +29405,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -30771,13 +29491,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -30815,6 +29535,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -30825,8 +29546,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -30834,10 +29558,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -30848,8 +29568,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -31016,13 +29734,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -31076,15 +29794,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -31108,13 +29826,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -31125,8 +29844,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -31134,10 +29856,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -31164,8 +29882,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -31253,13 +29969,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -31323,9 +30039,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -31343,15 +30059,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -31378,6 +30094,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -31388,8 +30105,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -31397,10 +30117,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -31522,13 +30238,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -31587,15 +30303,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -31608,6 +30324,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -31618,8 +30335,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -31627,10 +30347,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -31709,13 +30425,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -31769,15 +30485,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -31800,6 +30516,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -31810,8 +30527,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -31819,10 +30539,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -31872,750 +30588,1424 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + """ + + @distributed_trace + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a New App. + + Create a new app by submitting an app specification. For documentation on app specifications + (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. } ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. "domains": [ { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". } ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "domains": [ + }, + "routes": [ { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of the + component to route to. Required. + "preserve_path_prefix": "str", # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for Functions + Components and is mutually exclusive with ``rewrite``. + "rewrite": "str" # Optional. An + optional field that will rewrite the path of the component to + be what is specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with ``path=/api`` will + have requests to ``/api/list`` trimmed to ``/list``. If you + specified the rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. Note: this + is mutually exclusive with ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # Optional. The + authority/host to redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # Optional. The port to + redirect to. + "redirect_code": 0, # Optional. The + redirect code to use. Defaults to ``302``. Supported values + are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. The + scheme to redirect to. Supported values are ``http`` or + ``https``. Default: ``https``. + "uri": "str" # Optional. An optional + URI path to redirect to. Note: if this is specified the whole + URI of the original request will be overwritten to this + value, irrespective of the original request URI being + matched. } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. } - ] + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. }, - "jobs": [ + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a + component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the geographical + origin of the app. Default: ``nearest available``. Known values are: "ams", + "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. The + number of failed health checks before considered unhealthy. + "http_path": "str", # Optional. The route + path used for the HTTP health check ping. If not set, the HTTP + health check will be disabled and a TCP health check used + instead. + "initial_delay_seconds": 0, # Optional. The + number of seconds to wait before beginning health checks. + "period_seconds": 0, # Optional. The number + of seconds to wait between health checks. + "port": 0, # Optional. The port on which the + health check will be performed. If not set, the health check will + be performed on the component's http_port. + "success_threshold": 0, # Optional. The + number of successful health checks before considered healthy. + "timeout_seconds": 0 # Optional. The number + of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal port on + which this service's run command will listen. Default: 8080 If there + is not an environment variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which this + service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, # Optional. The number + of seconds to wait between selecting a container instance for + termination and issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain of new + requests on upstream load-balancers. (Default 15). + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "catchall_document": "str", # Optional. The name of + the document to use as the fallback for any requests to documents + that are not found when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. Default + value is "404.html". The name of the error document to use when + serving this static site. Default: 404.html. If no such file exists + within the built assets, App Platform will supply one. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "index_document": "index.html", # Optional. Default + value is "index.html". The name of the index document to use when + serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "output_dir": "str", # Optional. An optional path to + where the built assets will be located, relative to the build + context. If not set, App Platform will automatically scan for these + directory names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ] + }, + "project_id": "str" # Optional. The ID of the project the app should be + assigned to. If omitted, it will be assigned to your default project. + } + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } - } - ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -32662,686 +32052,887 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. } } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "static_sites": [ { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "active_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. "pending_steps": 0, # Optional. Number of pending steps. "running_steps": 0, # Optional. Number of currently @@ -33355,8 +32946,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -33387,8 +32978,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -33420,8 +33011,12 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -33431,11 +33026,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -33453,22 +33046,22 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -33478,6 +33071,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -33562,13 +33157,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -33606,6 +33201,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -33616,8 +33212,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -33625,10 +33224,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -33639,8 +33234,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -33807,13 +33400,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -33867,15 +33460,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -33899,13 +33492,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -33916,8 +33510,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -33925,10 +33522,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -33955,8 +33548,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -34044,13 +33635,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -34114,9 +33705,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -34134,15 +33725,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -34169,6 +33760,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -34179,8 +33771,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -34188,10 +33783,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -34313,13 +33904,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -34378,15 +33969,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -34399,6 +33990,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -34409,8 +34001,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -34418,10 +34013,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -34500,13 +34091,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -34560,15 +34151,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -34591,6 +34182,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -34601,8 +34193,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -34610,10 +34205,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -34663,7 +34254,76 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "pinned_deployment": { + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -34712,8 +34372,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -34744,8 +34404,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -34777,8 +34437,12 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -34788,11 +34452,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -34810,22 +34472,22 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -34835,6 +34497,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -34919,13 +34583,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -34963,6 +34627,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -34973,8 +34638,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -34982,10 +34650,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -34996,8 +34660,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -35164,13 +34826,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -35224,15 +34886,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -35256,13 +34918,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -35273,8 +34936,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -35282,10 +34948,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -35312,8 +34974,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -35401,13 +35061,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -35471,9 +35131,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -35491,15 +35151,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -35526,6 +35186,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -35536,8 +35197,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -35545,10 +35209,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -35670,13 +35330,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -35735,15 +35395,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -35756,6 +35416,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -35766,8 +35427,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -35775,10 +35439,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -35857,13 +35517,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -35917,15 +35577,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -35948,6 +35608,7 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -35958,8 +35619,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -35967,10 +35631,6 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -36020,285 +35680,221 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ] }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. } ], - "domains": [ + "id": "str", # Optional. The ID of the deployment. + "jobs": [ { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. } ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. } ], - "ingress": { - "rules": [ + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -36345,1054 +35941,1111 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. + }, + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. } ] }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_apps_create_request( - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def delete(self, id: str, **kwargs: Any) -> JSON: - """Delete an App. - - Delete an existing app. Once deleted, all active deployments will be permanently shut down and - the app deleted. If needed, be sure to back up your app specification so that you may re-create - it at a later time. - - :param id: The ID of the app. Required. - :type id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "id": "str" # Optional. The ID of the app that was deleted. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_delete_request( - id=id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: - """Retrieve an Existing App. - - Retrieve details about an existing app by either its ID or name. To retrieve an app by its - name, do not include an ID in the request path. Information about the current active deployment - as well as any in progress ones will also be included in the response. - - :param id: The ID of the app. Required. - :type id: str - :keyword name: The name of the app to retrieve. Default value is None. - :paramtype name: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { - "active_deployment": { + "pinned_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -37441,8 +37094,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -37473,8 +37126,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -37506,8 +37159,12 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -37517,11 +37174,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -37539,22 +37194,22 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -37564,6 +37219,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -37648,13 +37305,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -37692,6 +37349,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -37702,8 +37360,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -37711,10 +37372,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -37725,8 +37382,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -37893,13 +37548,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -37953,15 +37608,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -37985,13 +37640,14 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -38002,8 +37658,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -38011,10 +37670,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -38041,8 +37696,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -38130,13 +37783,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -38200,9 +37853,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -38220,15 +37873,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -38255,6 +37908,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -38265,8 +37919,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -38274,10 +37931,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -38399,13 +38052,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -38464,15 +38117,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -38485,6 +38138,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -38495,8 +38149,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -38504,10 +38161,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -38586,13 +38239,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -38646,15 +38299,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -38677,6 +38330,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -38687,8 +38341,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -38696,10 +38353,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -38749,38 +38402,268 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_apps_create_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete(self, id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete an App. + + Delete an existing app. Once deleted, all active deployments will be permanently shut down and + the app deleted. If needed, be sure to back up your app specification so that you may re-create + it at a later time. + + :param id: The ID of the app. Required. + :type id: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "id": "str" # Optional. The ID of the app that was deleted. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_delete_request( + id=id, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an Existing App. + + Retrieve details about an existing app by either its ID or name. To retrieve an app by its + name, do not include an ID in the request path. Information about the current active deployment + as well as any in progress ones will also be included in the response. + + :param id: The ID of the app. Required. + :type id: str + :keyword name: The name of the app to retrieve. Default value is None. + :paramtype name: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "app": { + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { "domain": "str", # The hostname for the domain. Required. "minimum_tls_version": "str", # Optional. @@ -38790,237 +38673,232 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. + "logtail": { + "token": "str" # Optional. + Logtail token. }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. } ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ + "ingress": { + "rules": [ { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -39067,161 +38945,1257 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "routes": [ + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "active_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], "allow_origins": [ { "exact": "str", # Optional. Exact string @@ -39319,13 +40293,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -39379,15 +40353,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -39411,13 +40385,14 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -39428,8 +40403,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -39437,10 +40415,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -39467,8 +40441,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -39556,13 +40528,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -39626,9 +40598,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -39646,15 +40618,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -39681,6 +40653,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -39691,8 +40664,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -39700,10 +40676,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -39825,13 +40797,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -39890,15 +40862,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -39911,6 +40883,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -39921,8 +40894,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -39930,10 +40906,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -40012,13 +40984,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -40072,15 +41044,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -40103,6 +41075,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -40113,8 +41086,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -40122,10 +41098,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -40175,65 +41147,126 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -40264,8 +41297,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -40297,8 +41330,12 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -40308,11 +41345,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -40330,22 +41365,22 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -40355,6 +41390,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -40439,13 +41476,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -40483,6 +41520,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -40493,8 +41531,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -40502,10 +41543,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -40516,8 +41553,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -40684,13 +41719,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -40744,15 +41779,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -40776,13 +41811,14 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -40793,8 +41829,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -40802,10 +41841,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -40832,8 +41867,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -40921,13 +41954,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -40991,9 +42024,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -41011,15 +42044,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -41046,6 +42079,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -41056,8 +42090,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -41065,10 +42102,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -41190,13 +42223,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -41255,15 +42288,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -41276,6 +42309,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -41286,8 +42320,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -41295,10 +42332,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -41377,13 +42410,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -41437,15 +42470,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -41468,6 +42501,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -41478,8 +42512,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -41487,10 +42524,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -41540,7 +42573,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } ] }, - "pinned_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -41589,8 +42630,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -41621,8 +42662,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -41654,8 +42695,12 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -41665,11 +42710,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -41687,22 +42730,22 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -41712,6 +42755,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -41796,13 +42841,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -41840,6 +42885,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -41850,8 +42896,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -41859,10 +42908,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -41873,8 +42918,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -42041,13 +43084,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -42101,15 +43144,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -42133,13 +43176,14 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -42150,8 +43194,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -42159,10 +43206,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -42189,8 +43232,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -42278,13 +43319,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -42348,9 +43389,9 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -42368,15 +43409,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -42403,6 +43444,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -42413,8 +43455,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -42422,10 +43467,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -42547,13 +43588,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -42612,15 +43653,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -42633,6 +43674,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -42643,8 +43685,11 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -42652,10 +43697,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -42734,13 +43775,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -42794,15 +43835,15 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -42825,6 +43866,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -42835,8 +43877,387 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. + } + ] + }, + "pinned_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -42844,10 +44265,987 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { "endpoint": "str", # OpenSearch API Endpoint. Only HTTPS is supported. Format: :code:``::code:``. Default port is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. + }, + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -42917,9 +45315,1249 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: available. "slug": "str" # Optional. The slug form of the region name. }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_request( + id=id, + name=name, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def update( + self, + id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update an App. + + Update an existing app by submitting a new app specification. For documentation on app + specifications (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param id: The ID of the app. Required. + :type id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ + { + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of the + component to route to. Required. + "preserve_path_prefix": "str", # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for Functions + Components and is mutually exclusive with ``rewrite``. + "rewrite": "str" # Optional. An + optional field that will rewrite the path of the component to + be what is specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with ``path=/api`` will + have requests to ``/api/list`` trimmed to ``/list``. If you + specified the rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. Note: this + is mutually exclusive with ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # Optional. The + authority/host to redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # Optional. The port to + redirect to. + "redirect_code": 0, # Optional. The + redirect code to use. Defaults to ``302``. Supported values + are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. The + scheme to redirect to. Supported values are ``http`` or + ``https``. Default: ``https``. + "uri": "str" # Optional. An optional + URI path to redirect to. Note: if this is specified the whole + URI of the original request will be overwritten to this + value, irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a + component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the geographical + origin of the app. Default: ``nearest available``. Known values are: "ams", + "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. The + number of failed health checks before considered unhealthy. + "http_path": "str", # Optional. The route + path used for the HTTP health check ping. If not set, the HTTP + health check will be disabled and a TCP health check used + instead. + "initial_delay_seconds": 0, # Optional. The + number of seconds to wait before beginning health checks. + "period_seconds": 0, # Optional. The number + of seconds to wait between health checks. + "port": 0, # Optional. The port on which the + health check will be performed. If not set, the health check will + be performed on the component's http_port. + "success_threshold": 0, # Optional. The + number of successful health checks before considered healthy. + "timeout_seconds": 0 # Optional. The number + of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal port on + which this service's run command will listen. Default: 8080 If there + is not an environment variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which this + service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, # Optional. The number + of seconds to wait between selecting a container instance for + termination and issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain of new + requests on upstream load-balancers. (Default 15). + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "catchall_document": "str", # Optional. The name of + the document to use as the fallback for any requests to documents + that are not found when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. Default + value is "404.html". The name of the error document to use when + serving this static site. Default: 404.html. If no such file exists + within the built assets, App Platform will supply one. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "index_document": "index.html", # Optional. Default + value is "index.html". The name of the index document to use when + serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "output_dir": "str", # Optional. An optional path to + where the built assets will be located, relative to the build + context. If not set, App Platform will automatically scan for these + directory names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ] + } + } + + # response body for status code(s): 200 + response == { + "app": { "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -42929,10 +46567,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -42950,21 +46586,21 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -42975,6 +46611,8 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -43052,13 +46690,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -43093,6 +46731,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -43103,18 +46742,17 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -43125,8 +46763,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -43287,13 +46923,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -43342,13 +46978,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -43371,13 +47007,14 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -43388,18 +47025,17 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -43426,8 +47062,6 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -43509,13 +47143,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -43573,7 +47207,7 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -43591,13 +47225,13 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -43623,1685 +47257,452 @@ def get(self, id: str, *, name: Optional[str] = None, **kwargs: Any) -> JSON: this service will listen for internal traffic. ], "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { "datadog": { "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ] - }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_request( - id=id, - name=name, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @overload - def update( - self, - id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> JSON: - """Update an App. - - Update an existing app by submitting a new app specification. For documentation on app - specifications (\ ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param id: The ID of the app. Required. - :type id: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name of the - underlying DigitalOcean DBaaS cluster. This is required for - production databases. For dev databases, if cluster_name is not set, - a new cluster will be provisioned. - "db_name": "str", # Optional. The name of the MySQL - or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of the MySQL - or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. - "production": bool, # Optional. Whether this is a - production or dev database. - "version": "str" # Optional. The version of the - database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the domain. - Required. - "minimum_tls_version": "str", # Optional. The - minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: - "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that - is displayed as the default in the control panel, used in bindable - environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A - non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", - "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. Indicates whether the - domain includes all sub-domains, in addition to the given domain. - "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # Optional. Is the - alert disabled?. - "operator": "UNSPECIFIED_OPERATOR", - # Optional. Default value is "UNSPECIFIED_OPERATOR". Known - values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": "UNSPECIFIED_RULE", # - Optional. Default value is "UNSPECIFIED_RULE". Known values - are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. Threshold - value for alert. - "window": "UNSPECIFIED_WINDOW" # - Optional. Default value is "UNSPECIFIED_WINDOW". Known values - are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # Optional. - Whether browsers should expose the response to the client-side - JavaScript code when the request"u2019s credentials mode is - include. This configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # Optional. The set of allowed - HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of allowed - HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. - Exact string match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "regex": "str" # Optional. - RE2 style regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For more - information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of HTTP - response headers that browsers are allowed to access. This - configures the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An optional - duration specifying how long browsers can cache the results of a - preflight request. This configures the ``Access-Control-Max-Age`` - header. - }, - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. - }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". - }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # - Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded to - the component. For example, a component with ``path=/api`` - will have requests to ``/api/list`` trimmed to ``/list``. If - this value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The name of the - component to route to. Required. - "preserve_path_prefix": "str", # - Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded to - the component. For example, a component with ``path=/api`` - will have requests to ``/api/list`` trimmed to ``/list``. If - this value is ``true``"" , the path will remain - ``/api/list``. Note: this is not applicable for Functions - Components and is mutually exclusive with ``rewrite``. - "rewrite": "str" # Optional. An - optional field that will rewrite the path of the component to - be what is specified here. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with ``path=/api`` will - have requests to ``/api/list`` trimmed to ``/list``. If you - specified the rewrite to be ``/v1/``"" , requests to - ``/api/list`` would be rewritten to ``/v1/list``. Note: this - is mutually exclusive with ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # Optional. The - authority/host to redirect to. This can be a hostname or IP - address. Note: use ``port`` to set the port. - "port": 0, # Optional. The port to - redirect to. - "redirect_code": 0, # Optional. The - redirect code to use. Defaults to ``302``. Supported values - are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. The - scheme to redirect to. Supported values are ``http`` or - ``https``. Default: ``https``. - "uri": "str" # Optional. An optional - URI path to redirect to. Note: if this is specified the whole - URI of the original request will be overwritten to this - value, irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } - }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, - "build_command": "str", # Optional. An optional - build command to run while building this component from source. - "dockerfile_path": "str", # Optional. The path to - the Dockerfile relative to the root of the repo. If set, it will be - used to build this component. Otherwise, App Platform will attempt to - build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full list, - please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. - }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "instance_count": 1, # Optional. Default value is 1. - The amount of instances that this component should be scaled to. - Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", # - Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to - use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a - component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str", # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The - number of seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate shutdown. - (Default 120). } - } - ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. - "region": "str", # Optional. The slug form of the geographical - origin of the app. Default: ``nearest available``. Known values are: "ams", - "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. - } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, - "build_command": "str", # Optional. An optional - build command to run while building this component from source. - "cors": { - "allow_credentials": bool, # Optional. - Whether browsers should expose the response to the client-side - JavaScript code when the request"u2019s credentials mode is - include. This configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # Optional. The set of allowed - HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of allowed - HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ { - "exact": "str", # Optional. - Exact string match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "regex": "str" # Optional. - RE2 style regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For more - information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } ], - "expose_headers": [ - "str" # Optional. The set of HTTP - response headers that browsers are allowed to access. This - configures the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An optional - duration specifying how long browsers can cache the results of a - preflight request. This configures the ``Access-Control-Max-Age`` - header. - }, - "dockerfile_path": "str", # Optional. The path to - the Dockerfile relative to the root of the repo. If set, it will be - used to build this component. Otherwise, App Platform will attempt to - build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full list, - please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. The - number of failed health checks before considered unhealthy. - "http_path": "str", # Optional. The route - path used for the HTTP health check ping. If not set, the HTTP - health check will be disabled and a TCP health check used - instead. - "initial_delay_seconds": 0, # Optional. The - number of seconds to wait before beginning health checks. - "period_seconds": 0, # Optional. The number - of seconds to wait between health checks. - "port": 0, # Optional. The port on which the - health check will be performed. If not set, the health check will - be performed on the component's http_port. - "success_threshold": 0, # Optional. The - number of successful health checks before considered healthy. - "timeout_seconds": 0 # Optional. The number - of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there - is not an environment variable with the name ``PORT``"" , one will be - automatically added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "instance_count": 1, # Optional. Default value is 1. - The amount of instances that this component should be scaled to. - Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", # - Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to - use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which this - service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. Logtail - token. + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # - Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded to - the component. For example, a component with ``path=/api`` - will have requests to ``/api/list`` trimmed to ``/list``. If - this value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str", # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - "termination": { - "drain_seconds": 0, # Optional. The number - of seconds to wait between selecting a container instance for - termination and issuing the TERM signal. Selecting a container - instance for termination begins an asynchronous drain of new - requests on upstream load-balancers. (Default 15). - "grace_period_seconds": 0 # Optional. The - number of seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate shutdown. - (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An optional - build command to run while building this component from source. - "catchall_document": "str", # Optional. The name of - the document to use as the fallback for any requests to documents - that are not found when serving this static site. Only 1 of - ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # Optional. - Whether browsers should expose the response to the client-side - JavaScript code when the request"u2019s credentials mode is - include. This configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # Optional. The set of allowed - HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of allowed - HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ { - "exact": "str", # Optional. - Exact string match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "regex": "str" # Optional. - RE2 style regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For more - information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of HTTP - response headers that browsers are allowed to access. This - configures the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An optional - duration specifying how long browsers can cache the results of a - preflight request. This configures the ``Access-Control-Max-Age`` - header. - }, - "dockerfile_path": "str", # Optional. The path to - the Dockerfile relative to the root of the repo. If set, it will be - used to build this component. Otherwise, App Platform will attempt to - build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full list, - please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. Default - value is "404.html". The name of the error document to use when - serving this static site. Default: 404.html. If no such file exists - within the built assets, App Platform will supply one. - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. - }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "index_document": "index.html", # Optional. Default - value is "index.html". The name of the index document to use when - serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "output_dir": "str", # Optional. An optional path to - where the built assets will be located, relative to the build - context. If not set, App Platform will automatically scan for these - directory names: ``_static``"" , ``dist``"" , ``public``"" , - ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across all - components within an app. - "preserve_path_prefix": bool # - Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded to - the component. For example, a component with ``path=/api`` - will have requests to ``/api/list`` trimmed to ``/list``. If - this value is ``true``"" , the path will remain - ``/api/list``. - } - ], - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str" # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. The - maximum amount of instances for this component. Must be more than - min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # Optional. - Default value is 80. The average target CPU utilization - for the component. + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. The - minimum amount of instances for this component. Must be less than - max_instance_count. - }, - "build_command": "str", # Optional. An optional - build command to run while building this component from source. - "dockerfile_path": "str", # Optional. The path to - the Dockerfile relative to the root of the repo. If set, it will be - used to build this component. Otherwise, App Platform will attempt to - build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full list, - please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "instance_count": 1, # Optional. Default value is 1. - The amount of instances that this component should be scaled to. - Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", # - Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to - use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. Logtail - token. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str", # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The - number of seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate shutdown. - (Default 120). } - } - ] - } - } - - # response body for status code(s): 200 - response == { - "app": { + ] + }, "active_deployment": { "cause": "str", # Optional. What caused this deployment to be created. @@ -45351,8 +47752,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -45383,8 +47784,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -45416,8 +47817,12 @@ def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -45427,11 +47832,9 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -45449,22 +47852,22 @@ def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -45474,6 +47877,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -45558,13 +47963,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -45602,6 +48007,7 @@ def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -45612,8 +48018,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -45621,10 +48030,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -45635,8 +48040,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -45803,13 +48206,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -45863,15 +48266,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -45895,13 +48298,14 @@ def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -45912,8 +48316,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -45921,10 +48328,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -45951,8 +48354,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -46040,13 +48441,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -46110,9 +48511,9 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -46130,15 +48531,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -46165,6 +48566,7 @@ def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -46175,8 +48577,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -46184,10 +48589,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -46309,13 +48710,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -46374,15 +48775,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -46395,6 +48796,7 @@ def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -46405,8 +48807,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -46414,10 +48819,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -46496,13 +48897,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -46556,15 +48957,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -46587,6 +48988,7 @@ def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -46597,8 +48999,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -46606,10 +49011,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -46700,21 +49101,21 @@ def update( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. }, "validations": [ @@ -46777,8 +49178,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -46809,8 +49210,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -46842,8 +49243,12 @@ def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -46853,11 +49258,9 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -46875,22 +49278,22 @@ def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -46900,6 +49303,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -46984,13 +49389,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47028,6 +49433,7 @@ def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -47038,8 +49444,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -47047,10 +49456,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -47061,8 +49466,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -47229,13 +49632,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47289,15 +49692,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -47321,13 +49724,14 @@ def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -47338,8 +49742,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -47347,10 +49754,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -47377,8 +49780,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -47466,13 +49867,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47536,9 +49937,9 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -47556,15 +49957,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -47591,6 +49992,7 @@ def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -47601,8 +50003,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -47610,10 +50015,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -47735,13 +50136,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47800,15 +50201,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -47821,6 +50222,7 @@ def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -47831,8 +50233,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -47840,10 +50245,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -47922,13 +50323,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -47982,15 +50383,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -48013,6 +50414,7 @@ def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -48023,8 +50425,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -48032,10 +50437,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -48142,8 +50543,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -48174,8 +50575,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -48207,8 +50608,12 @@ def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -48218,11 +50623,9 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -48240,22 +50643,22 @@ def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -48265,6 +50668,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -48349,13 +50754,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -48393,6 +50798,7 @@ def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -48403,8 +50809,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -48412,10 +50821,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -48426,8 +50831,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -48594,13 +50997,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -48654,15 +51057,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -48686,13 +51089,14 @@ def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -48703,8 +51107,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -48712,10 +51119,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -48742,8 +51145,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -48831,13 +51232,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -48901,9 +51302,9 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -48921,15 +51322,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -48956,6 +51357,7 @@ def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -48966,8 +51368,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -48975,10 +51380,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -49100,13 +51501,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -49165,15 +51566,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -49186,6 +51587,7 @@ def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -49196,8 +51598,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -49205,10 +51610,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -49287,13 +51688,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -49347,15 +51748,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -49378,6 +51779,7 @@ def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -49388,8 +51790,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -49397,10 +51802,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -49499,8 +51900,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -49531,8 +51932,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -49564,8 +51965,12 @@ def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -49575,11 +51980,9 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -49597,22 +52000,22 @@ def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -49622,6 +52025,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -49706,13 +52111,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -49750,6 +52155,7 @@ def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -49760,8 +52166,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -49769,10 +52178,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -49783,8 +52188,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -49951,13 +52354,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -50011,15 +52414,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -50043,13 +52446,14 @@ def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -50060,8 +52464,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -50069,10 +52476,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -50099,8 +52502,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -50188,13 +52589,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -50258,9 +52659,9 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -50278,15 +52679,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -50313,6 +52714,7 @@ def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -50323,8 +52725,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -50332,10 +52737,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -50457,13 +52858,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -50522,15 +52923,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -50543,6 +52944,7 @@ def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -50553,8 +52955,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -50562,10 +52967,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -50644,13 +53045,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -50704,15 +53105,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -50735,6 +53136,7 @@ def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -50745,8 +53147,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -50754,10 +53159,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -50827,9 +53228,65 @@ def update( available. "slug": "str" # Optional. The slug form of the region name. }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def update( + self, + id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update an App. + + Update an existing app by submitting a new app specification. For documentation on app + specifications (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param id: The ID of the app. Required. + :type id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "app": { "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -50839,10 +53296,8 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -50860,21 +53315,21 @@ def update( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -50885,6 +53340,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -50962,13 +53419,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -51003,6 +53460,7 @@ def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -51013,18 +53471,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -51035,8 +53492,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -51197,13 +53652,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -51252,13 +53707,13 @@ def update( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -51281,13 +53736,14 @@ def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -51298,18 +53754,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -51336,8 +53791,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -51419,13 +53872,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -51483,7 +53936,7 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -51501,13 +53954,13 @@ def update( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -51533,6 +53986,7 @@ def update( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -51543,18 +53997,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -51669,13 +54122,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -51729,13 +54182,13 @@ def update( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -51749,6 +54202,7 @@ def update( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -51759,18 +54213,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -51847,13 +54300,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -51902,13 +54355,13 @@ def update( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -51930,6 +54383,7 @@ def update( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -51940,18 +54394,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -51979,57 +54432,6 @@ def update( } ] }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - def update( - self, - id: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> JSON: - """Update an App. - - Update an existing app by submitting a new app specification. For documentation on app - specifications (\ ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param id: The ID of the app. Required. - :type id: str - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { "active_deployment": { "cause": "str", # Optional. What caused this deployment to be created. @@ -52079,8 +54481,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -52111,8 +54513,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -52144,8 +54546,12 @@ def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -52155,11 +54561,9 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -52177,22 +54581,22 @@ def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -52202,6 +54606,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -52286,13 +54692,947 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The + name of the component to route to. Required. + "preserve_path_prefix": "str", # Optional. An + optional flag to preserve the path that is forwarded + to the backend service. By default, the HTTP request + path will be trimmed from the left when forwarded to + the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. Note: this is not + applicable for Functions Components and is mutually + exclusive with ``rewrite``. + "rewrite": "str" # + Optional. An optional field that will rewrite the + path of the component to be what is specified here. + By default, the HTTP request path will be trimmed + from the left when forwarded to the component. For + example, a component with ``path=/api`` will have + requests to ``/api/list`` trimmed to ``/list``. If + you specified the rewrite to be ``/v1/``"" , requests + to ``/api/list`` would be rewritten to ``/v1/list``. + Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": + bool, # Optional. Whether browsers should expose the + response to the client-side JavaScript code when the + request"u2019s credentials mode is include. This + configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # + Optional. The set of allowed HTTP request + headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # + Optional. The set of allowed HTTP methods. This + configures the ``Access-Control-Allow-Methods`` + header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. Exact string + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "prefix": "str", # Optional. Prefix-based + match. Only 1 of ``exact``"" , ``prefix``"" , + or ``regex`` must be set. + "regex": "str" # Optional. RE2 style + regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For + more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # + Optional. The set of HTTP response headers that + browsers are allowed to access. This configures + the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # + Optional. An optional duration specifying how long + browsers can cache the results of a preflight + request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": + "str" # Prefix-based match. For example, + ``/api`` will match ``/api``"" , ``/api/``"" , + and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", + # Optional. The authority/host to redirect to. This + can be a hostname or IP address. Note: use ``port`` + to set the port. + "port": 0, # + Optional. The port to redirect to. + "redirect_code": 0, + # Optional. The redirect code to use. Defaults to + ``302``. Supported values are 300, 301, 302, 303, + 304, 307, 308. + "scheme": "str", # + Optional. The scheme to redirect to. Supported values + are ``http`` or ``https``. Default: ``https``. + "uri": "str" # + Optional. An optional URI path to redirect to. Note: + if this is specified the whole URI of the original + request will be overwritten to this value, + irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * UNSPECIFIED: Default job + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * + POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after + a component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", + and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # + Optional. The number of failed health checks before + considered unhealthy. + "http_path": "str", # + Optional. The route path used for the HTTP health check + ping. If not set, the HTTP health check will be disabled + and a TCP health check used instead. + "initial_delay_seconds": 0, + # Optional. The number of seconds to wait before + beginning health checks. + "period_seconds": 0, # + Optional. The number of seconds to wait between health + checks. + "port": 0, # Optional. The + port on which the health check will be performed. If not + set, the health check will be performed on the + component's http_port. + "success_threshold": 0, # + Optional. The number of successful health checks before + considered healthy. + "timeout_seconds": 0 # + Optional. The number of seconds after which the check + times out. + }, + "http_port": 0, # Optional. The + internal port on which this service's run command will + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on + which this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ + { + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } + }, + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. + }, + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -52329,7 +55669,55 @@ def update( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -52340,8 +55728,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -52349,10 +55740,451 @@ def update( "user": "str" # Username to authenticate with. Required. }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. + } + ] + }, + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the app. + "dedicated_ips": [ + { + "id": "str", # Optional. The ID of the dedicated + egress IP. + "ip": "str", # Optional. The IP address of the + dedicated egress IP. + "status": "UNKNOWN" # Optional. Default value is + "UNKNOWN". The status of the dedicated egress IP. Known values are: + "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". + } + ], + "default_ingress": "str", # Optional. The default hostname on which + the app is accessible. + "domains": [ + { + "certificate_expires_at": "2020-02-20 00:00:00", # + Optional. Current SSL certificate expiration time. + "id": "str", # Optional. The ID of the domain. + "phase": "UNKNOWN", # Optional. Default value is + "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", + "ACTIVE", and "ERROR". + "progress": { + "steps": [ + {} # Optional. The steps of the + domain's progress. + ] + }, + "rotate_validation_records": bool, # Optional. + Validation values have changed and require manual intervention. + "spec": { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + }, + "validations": [ + { + "txt_name": "str", # Optional. TXT + record name. + "txt_value": "str" # Optional. TXT + record value. + } + ] + } + ], + "id": "str", # Optional. The ID of the application. + "in_progress_deployment": { + "cause": "str", # Optional. What caused this deployment to + be created. + "cloned_from": "str", # Optional. The ID of a previous + deployment that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The + namespace where the functions are deployed. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + functions component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this + job. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". + Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", + "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and + "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. + When the deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful + steps. + "pending_steps": 0, # Optional. Number of pending + steps. + "running_steps": 0, # Optional. Number of currently + running steps. + "steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful + steps. + "summary_steps": [ + { + "component_name": "str", # Optional. + The component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. + The base of a human-readable description of the step intended + to be combined with the component name for presentation. For + example: ``message_base`` = "Building service" + ``component_name`` = "api". + "name": "str", # Optional. The name + of this step. + "reason": { + "code": "str", # Optional. + The error code. + "message": "str" # Optional. + The error message. + }, + "started_at": "2020-02-20 00:00:00", + # Optional. The start time of this step. + "status": "UNKNOWN", # Optional. + Default value is "UNKNOWN". Known values are: "UNKNOWN", + "PENDING", "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps + of this step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this + service. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this + service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "cluster_name": "str", # Optional. + The name of the underlying DigitalOcean DBaaS cluster. This + is required for production databases. For dev databases, if + cluster_name is not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The + name of the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The + name of the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * + REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and + "REDIS". + "production": bool, # Optional. + Whether this is a production or dev database. + "version": "str" # Optional. The + version of the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for + the domain. Required. + "minimum_tls_version": "str", # + Optional. The minimum version of TLS a client application can + use to access resources for the domain. Must be one of the + following values wrapped within quotations: ``"1.2"`` or + ``"1.3"``. Known values are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. + Default value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * + PRIMARY: The primary domain for this app that is displayed as + the default in the control panel, used in bindable + environment variables, and any other places that reference an + app's live URL. Only one domain may be set as primary. * + ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", + "DEFAULT", "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. + Indicates whether the domain includes all sub-domains, in + addition to the given domain. + "zone": "str" # Optional. Optional. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default + value is "AUTOASSIGN". The app egress type. Known values are: + "AUTOASSIGN" and "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be + unique across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": + "UNSPECIFIED_RULE", # Optional. Default value is + "UNSPECIFIED_RULE". Known values are: + "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", + "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", + "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # + Optional. Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { "endpoint": "str", # OpenSearch API Endpoint. Only HTTPS is supported. Format: :code:``::code:``. Default port is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -52363,8 +56195,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -52531,13 +56361,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -52591,15 +56421,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -52623,13 +56453,14 @@ def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -52640,8 +56471,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -52649,10 +56483,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -52679,8 +56509,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -52768,13 +56596,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -52838,9 +56666,9 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -52858,15 +56686,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -52893,6 +56721,7 @@ def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -52903,8 +56732,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -52912,10 +56744,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -53037,13 +56865,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -53102,15 +56930,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -53123,6 +56951,7 @@ def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -53133,8 +56962,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -53142,10 +56974,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -53224,13 +57052,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -53284,15 +57112,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -53315,6 +57143,7 @@ def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -53325,8 +57154,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -53334,10 +57166,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -53387,76 +57215,15 @@ def update( } ] }, - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the app. - "dedicated_ips": [ - { - "id": "str", # Optional. The ID of the dedicated - egress IP. - "ip": "str", # Optional. The IP address of the - dedicated egress IP. - "status": "UNKNOWN" # Optional. Default value is - "UNKNOWN". The status of the dedicated egress IP. Known values are: - "UNKNOWN", "ASSIGNING", "ASSIGNED", and "REMOVED". - } - ], - "default_ingress": "str", # Optional. The default hostname on which - the app is accessible. - "domains": [ - { - "certificate_expires_at": "2020-02-20 00:00:00", # - Optional. Current SSL certificate expiration time. - "id": "str", # Optional. The ID of the domain. - "phase": "UNKNOWN", # Optional. Default value is - "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING", - "ACTIVE", and "ERROR". - "progress": { - "steps": [ - {} # Optional. The steps of the - domain's progress. - ] - }, - "rotate_validation_records": bool, # Optional. - Validation values have changed and require manual intervention. - "spec": { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - }, - "validations": [ - { - "txt_name": "str", # Optional. TXT - record name. - "txt_value": "str" # Optional. TXT - record value. - } - ] - } - ], - "id": "str", # Optional. The ID of the application. - "in_progress_deployment": { + "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The + creation time of the last deployment. + "live_domain": "str", # Optional. The live domain of the app. + "live_url": "str", # Optional. The live URL of the app. + "live_url_base": "str", # Optional. The live URL base of the app, + the URL excluding the path. + "owner_uuid": "str", # Optional. The ID of the account to which the + application belongs. + "pending_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -53505,8 +57272,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -53537,8 +57304,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -53570,8 +57337,12 @@ def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -53581,11 +57352,9 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -53603,22 +57372,22 @@ def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -53628,6 +57397,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -53712,13 +57483,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -53756,6 +57527,7 @@ def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -53766,8 +57538,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -53775,10 +57550,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -53789,8 +57560,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -53957,13 +57726,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -54017,15 +57786,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -54049,13 +57818,14 @@ def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -54066,8 +57836,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -54075,10 +57848,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -54105,8 +57874,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -54194,13 +57961,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -54264,9 +58031,9 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -54284,15 +58051,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -54319,6 +58086,7 @@ def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -54329,8 +58097,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -54338,10 +58109,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -54463,13 +58230,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -54528,15 +58295,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -54549,6 +58316,7 @@ def update( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -54559,8 +58327,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -54568,10 +58339,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -54650,13 +58417,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -54710,15 +58477,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -54741,6 +58508,7 @@ def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -54751,8 +58519,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -54760,10 +58531,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -54813,15 +58580,7 @@ def update( } ] }, - "last_deployment_created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the last deployment. - "live_domain": "str", # Optional. The live domain of the app. - "live_url": "str", # Optional. The live URL of the app. - "live_url_base": "str", # Optional. The live URL base of the app, - the URL excluding the path. - "owner_uuid": "str", # Optional. The ID of the account to which the - application belongs. - "pending_deployment": { + "pinned_deployment": { "cause": "str", # Optional. What caused this deployment to be created. "cloned_from": "str", # Optional. The ID of a previous @@ -54870,8 +58629,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -54902,8 +58661,8 @@ def update( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -54935,8 +58694,12 @@ def update( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -54946,11 +58709,9 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -54968,22 +58729,22 @@ def update( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -54993,6 +58754,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -55077,13 +58840,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -55121,6 +58884,7 @@ def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -55131,8 +58895,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -55140,10 +58907,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -55154,8 +58917,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -55322,13 +59083,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -55382,15 +59143,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -55414,13 +59175,14 @@ def update( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -55431,8 +59193,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -55440,10 +59205,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -55470,8 +59231,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -55559,13 +59318,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -55629,9 +59388,9 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -55649,15 +59408,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -55684,6 +59443,7 @@ def update( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -55694,238 +59454,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, "endpoint": "str", # OpenSearch API Endpoint. Only HTTPS is supported. Format: :code:``::code:``. Default port is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { "basic_auth": { "password": "str", # Password for user defined in User. @@ -55933,10 +59466,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -55949,11 +59478,6 @@ def update( }, "name": "str", # Optional. The name. Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -55970,177 +59494,6 @@ def update( the path will remain ``/api/list``. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. "run_command": "str", # Optional. An optional run command to override the component's default. "source_dir": "str", # Optional. An @@ -56148,239 +59501,29 @@ def update( For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "pinned_deployment": { - "cause": "str", # Optional. What caused this deployment to - be created. - "cloned_from": "str", # Optional. The ID of a previous - deployment that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The - creation time of the deployment. - "functions": [ - { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The - namespace where the functions are deployed. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - functions component. - } - ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ - { - "name": "str", # Optional. The name of this - job. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this job. - } - ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". - Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", - "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and - "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. - When the deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful - steps. - "pending_steps": 0, # Optional. Number of pending - steps. - "running_steps": 0, # Optional. Number of currently - running steps. - "steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful - steps. - "summary_steps": [ - { - "component_name": "str", # Optional. - The component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. - The base of a human-readable description of the step intended - to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name - of this step. - "reason": { - "code": "str", # Optional. - The error code. - "message": "str" # Optional. - The error message. - }, - "started_at": "2020-02-20 00:00:00", - # Optional. The start time of this step. - "status": "UNKNOWN", # Optional. - Default value is "UNKNOWN". Known values are: "UNKNOWN", - "PENDING", "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps - of this step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. - }, - "services": [ - { - "name": "str", # Optional. The name of this - service. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this - service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. - The name of the underlying DigitalOcean DBaaS cluster. This - is required for production databases. For dev databases, if - cluster_name is not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The - name of the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The - name of the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* - REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and - "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. - "production": bool, # Optional. - Whether this is a production or dev database. - "version": "str" # Optional. The - version of the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for - the domain. Required. - "minimum_tls_version": "str", # - Optional. The minimum version of TLS a client application can - use to access resources for the domain. Must be one of the - following values wrapped within quotations: ``"1.2"`` or - ``"1.3"``. Known values are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* - PRIMARY: The primary domain for this app that is displayed as - the default in the control panel, used in bindable - environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* - ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", - "DEFAULT", "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. - Indicates whether the domain includes all sub-domains, in - addition to the given domain. - "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default - value is "AUTOASSIGN". The app egress type. Known values are: - "AUTOASSIGN" and "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": - "UNSPECIFIED_RULE", # Optional. Default value is - "UNSPECIFIED_RULE". Known values are: - "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", - "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", - "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # - Optional. Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to @@ -56427,6 +59570,16 @@ def update( cache the results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. "envs": [ { "key": "str", # The @@ -56434,13 +59587,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -56450,6 +59603,11 @@ def update( used. } ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. "git": { "branch": "str", # Optional. The name of the branch to use. @@ -56477,7 +59635,45 @@ def update( The name of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. + }, + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -56488,8 +59684,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -56497,10 +59696,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -56511,8 +59706,13 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. "routes": [ { "path": "str", # @@ -56529,120 +59729,15 @@ def update( the path will remain ``/api/list``. } ], + "run_command": "str", # Optional. An + optional run command to override the component's default. "source_dir": "str" # Optional. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo. } ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The - name of the component to route to. Required. - "preserve_path_prefix": "str", # Optional. An - optional flag to preserve the path that is forwarded - to the backend service. By default, the HTTP request - path will be trimmed from the left when forwarded to - the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. Note: this is not - applicable for Functions Components and is mutually - exclusive with ``rewrite``. - "rewrite": "str" # - Optional. An optional field that will rewrite the - path of the component to be what is specified here. - By default, the HTTP request path will be trimmed - from the left when forwarded to the component. For - example, a component with ``path=/api`` will have - requests to ``/api/list`` trimmed to ``/list``. If - you specified the rewrite to be ``/v1/``"" , requests - to ``/api/list`` would be rewritten to ``/v1/list``. - Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": - bool, # Optional. Whether browsers should expose the - response to the client-side JavaScript code when the - request"u2019s credentials mode is include. This - configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # - Optional. The set of allowed HTTP request - headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # - Optional. The set of allowed HTTP methods. This - configures the ``Access-Control-Allow-Methods`` - header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. Exact string - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "prefix": "str", # Optional. Prefix-based - match. Only 1 of ``exact``"" , ``prefix``"" , - or ``regex`` must be set. - "regex": "str" # Optional. RE2 style - regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For - more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # - Optional. The set of HTTP response headers that - browsers are allowed to access. This configures - the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # - Optional. An optional duration specifying how long - browsers can cache the results of a preflight - request. This configures the - ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": - "str" # Prefix-based match. For example, - ``/api`` will match ``/api``"" , ``/api/``"" , - and any nested paths such as - ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", - # Optional. The authority/host to redirect to. This - can be a hostname or IP address. Note: use ``port`` - to set the port. - "port": 0, # - Optional. The port to redirect to. - "redirect_code": 0, - # Optional. The redirect code to use. Defaults to - ``302``. Supported values are 300, 301, 302, 303, - 304, 307, 308. - "scheme": "str", # - Optional. The scheme to redirect to. Supported values - are ``http`` or ``https``. Default: ``https``. - "uri": "str" # - Optional. An optional URI path to redirect to. Note: - if this is specified the whole URI of the original - request will be overwritten to this value, - irrespective of the original request URI being - matched. - } - } - ] - }, - "jobs": [ + "workers": [ { "autoscaling": { "max_instance_count": 0, # @@ -56679,13 +59774,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -56739,15 +59834,15 @@ def update( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -56769,15 +59864,8 @@ def update( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. - Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* - POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after - a component fails to deploy. Known values are: "UNSPECIFIED", - "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -56788,8 +59876,11 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -56797,10 +59888,6 @@ def update( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -56826,738 +59913,1205 @@ def update( causes immediate shutdown. (Default 120). } } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. + } + ] + }, + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, + "tier_slug": "str", # Optional. The current pricing tier slug of the + app. + "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's + last configuration update. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def update(self, id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update an App. + + Update an existing app by submitting a new app specification. For documentation on app + specifications (\\ ``AppSpec`` objects), please refer to `the product documentation + `_. + + :param id: The ID of the app. Required. + :type id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ + { + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of the + component to route to. Required. + "preserve_path_prefix": "str", # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for Functions + Components and is mutually exclusive with ``rewrite``. + "rewrite": "str" # Optional. An + optional field that will rewrite the path of the component to + be what is specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with ``path=/api`` will + have requests to ``/api/list`` trimmed to ``/list``. If you + specified the rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. Note: this + is mutually exclusive with ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # Optional. The + authority/host to redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # Optional. The port to + redirect to. + "redirect_code": 0, # Optional. The + redirect code to use. Defaults to ``302``. Supported values + are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. The + scheme to redirect to. Supported values are ``http`` or + ``https``. Default: ``https``. + "uri": "str" # Optional. An optional + URI path to redirect to. Note: if this is specified the whole + URI of the original request will be overwritten to this + value, irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a + component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the geographical + origin of the app. Default: ``nearest available``. Known values are: "ams", + "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. The + number of failed health checks before considered unhealthy. + "http_path": "str", # Optional. The route + path used for the HTTP health check ping. If not set, the HTTP + health check will be disabled and a TCP health check used + instead. + "initial_delay_seconds": 0, # Optional. The + number of seconds to wait before beginning health checks. + "period_seconds": 0, # Optional. The number + of seconds to wait between health checks. + "port": 0, # Optional. The port on which the + health check will be performed. If not set, the health check will + be performed on the component's http_port. + "success_threshold": 0, # Optional. The + number of successful health checks before considered healthy. + "timeout_seconds": 0 # Optional. The number + of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal port on + which this service's run command will listen. Default: 8080 If there + is not an environment variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which this + service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, # Optional. The number + of seconds to wait between selecting a container instance for + termination and issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain of new + requests on upstream load-balancers. (Default 15). + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "catchall_document": "str", # Optional. The name of + the document to use as the fallback for any requests to documents + that are not found when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", - and "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # - Optional. The number of failed health checks before - considered unhealthy. - "http_path": "str", # - Optional. The route path used for the HTTP health check - ping. If not set, the HTTP health check will be disabled - and a TCP health check used instead. - "initial_delay_seconds": 0, - # Optional. The number of seconds to wait before - beginning health checks. - "period_seconds": 0, # - Optional. The number of seconds to wait between health - checks. - "port": 0, # Optional. The - port on which the health check will be performed. If not - set, the health check will be performed on the - component's http_port. - "success_threshold": 0, # - Optional. The number of successful health checks before - considered healthy. - "timeout_seconds": 0 # - Optional. The number of seconds after which the check - times out. - }, - "http_port": 0, # Optional. The - internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on - which this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "error_document": "404.html", # Optional. Default + value is "404.html". The name of the error document to use when + serving this static site. Default: 404.html. If no such file exists + within the built assets, App Platform will supply one. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "index_document": "index.html", # Optional. Default + value is "index.html". The name of the index document to use when + serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ], - "static_sites": [ + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "output_dir": "str", # Optional. An optional path to + where the built assets will be located, relative to the build + context. If not set, App Platform will automatically scan for these + directory names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } ], - "workers": [ + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } + }, + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). } - ] - }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, + } + ] + } + } + + # response body for status code(s): 200 + response == { + "app": { "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -57567,10 +61121,8 @@ def update( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -57588,21 +61140,21 @@ def update( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -57613,6 +61165,8 @@ def update( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -57690,13 +61244,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -57731,6 +61285,7 @@ def update( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -57741,18 +61296,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -57763,8 +61317,6 @@ def update( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -57925,13 +61477,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -57980,13 +61532,13 @@ def update( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -58009,13 +61561,14 @@ def update( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -58026,18 +61579,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -58064,8 +61616,6 @@ def update( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -58147,13 +61697,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -58211,7 +61761,7 @@ def update( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -58229,13 +61779,13 @@ def update( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -58261,6 +61811,7 @@ def update( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -58271,18 +61822,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -58397,13 +61947,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -58457,13 +62007,13 @@ def update( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -58477,6 +62027,7 @@ def update( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -58487,18 +62038,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -58575,13 +62125,13 @@ def update( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -58630,13 +62180,13 @@ def update( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -58658,6 +62208,7 @@ def update( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -58668,18 +62219,17 @@ def update( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -58707,50 +62257,6 @@ def update( } ] }, - "tier_slug": "str", # Optional. The current pricing tier slug of the - app. - "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's - last configuration update. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace - def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Update an App. - - Update an existing app by submitting a new app specification. For documentation on app - specifications (\ ``AppSpec`` objects), please refer to `the product documentation - `_. - - :param id: The ID of the app. Required. - :type id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "app": { "active_deployment": { "cause": "str", # Optional. What caused this deployment to be created. @@ -58800,8 +62306,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -58832,8 +62338,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -58865,8 +62371,12 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -58876,11 +62386,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -58898,22 +62406,22 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -58923,6 +62431,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -59007,13 +62517,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59051,6 +62561,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -59061,8 +62572,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -59070,10 +62584,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -59084,8 +62594,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -59252,13 +62760,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59312,15 +62820,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -59344,13 +62852,14 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -59361,8 +62870,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -59370,10 +62882,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -59400,8 +62908,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -59489,13 +62995,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59559,9 +63065,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -59579,15 +63085,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -59614,6 +63120,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -59624,8 +63131,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -59633,10 +63143,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -59758,13 +63264,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -59823,15 +63329,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -59844,6 +63350,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -59854,8 +63361,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -59863,10 +63373,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -59945,13 +63451,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -60005,15 +63511,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -60036,6 +63542,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -60046,8 +63553,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -60055,10 +63565,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -60149,21 +63655,21 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. }, "validations": [ @@ -60226,8 +63732,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -60258,8 +63764,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -60291,8 +63797,12 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -60302,11 +63812,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -60324,22 +63832,22 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -60349,6 +63857,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -60433,13 +63943,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -60477,6 +63987,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -60487,8 +63998,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -60496,10 +64010,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -60510,8 +64020,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -60678,13 +64186,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -60738,15 +64246,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -60770,13 +64278,14 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -60787,8 +64296,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -60796,10 +64308,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -60826,8 +64334,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -60915,13 +64421,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -60985,9 +64491,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -61005,15 +64511,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -61040,6 +64546,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -61050,8 +64557,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -61059,10 +64569,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -61184,13 +64690,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -61249,15 +64755,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -61270,6 +64776,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -61280,8 +64787,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -61289,10 +64799,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -61371,13 +64877,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -61431,15 +64937,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -61462,6 +64968,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -61472,8 +64979,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -61481,10 +64991,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -61591,8 +65097,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -61623,8 +65129,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -61656,8 +65162,12 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -61667,11 +65177,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -61689,22 +65197,22 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -61714,6 +65222,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -61798,13 +65308,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -61842,6 +65352,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -61852,8 +65363,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -61861,10 +65375,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -61875,8 +65385,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -62043,13 +65551,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -62103,15 +65611,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -62135,13 +65643,14 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -62152,8 +65661,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -62161,10 +65673,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -62191,8 +65699,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -62280,13 +65786,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -62350,9 +65856,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -62370,15 +65876,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -62405,6 +65911,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -62415,8 +65922,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -62424,10 +65934,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -62549,13 +66055,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -62614,15 +66120,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -62635,6 +66141,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -62645,8 +66152,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -62654,10 +66164,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -62736,13 +66242,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -62796,15 +66302,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -62827,6 +66333,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -62837,8 +66344,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -62846,10 +66356,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -62948,8 +66454,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -62980,8 +66486,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -63013,8 +66519,12 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -63024,11 +66534,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -63046,22 +66554,22 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -63071,6 +66579,8 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -63155,13 +66665,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -63199,6 +66709,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -63209,8 +66720,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -63218,10 +66732,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -63232,8 +66742,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -63400,13 +66908,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -63460,15 +66968,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -63492,13 +67000,14 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -63509,8 +67018,11 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -63518,10 +67030,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -63548,8 +67056,6 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -63637,13 +67143,13 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -63707,9 +67213,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -63727,15 +67233,15 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -63762,428 +67268,7 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: which this service will listen for internal traffic. ], "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # - Optional. The number of seconds to wait between selecting - a container instance for termination and issuing the TERM - signal. Selecting a container instance for termination - begins an asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "catchall_document": "str", # - Optional. The name of the document to use as the fallback for - any requests to documents that are not found when serving - this static site. Only 1 of ``catchall_document`` or - ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "error_document": "404.html", # - Optional. Default value is "404.html". The name of the error - document to use when serving this static site. Default: - 404.html. If no such file exists within the built assets, App - Platform will supply one. - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "index_document": "index.html", # - Optional. Default value is "index.html". The name of the - index document to use when serving this static site. Default: - index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # - Datadog API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # - Optional. Logtail token. - }, "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "output_dir": "str", # Optional. An - optional path to where the built assets will be located, - relative to the build context. If not set, App Platform will - automatically scan for these directory names: ``_static``"" , - ``dist``"" , ``public``"" , ``build``. - "routes": [ - { - "path": "str", # - Optional. (Deprecated - Use Ingress Rules instead). - An HTTP path prefix. Paths must start with / and must - be unique across all components within an app. - "preserve_path_prefix": bool # Optional. An optional - flag to preserve the path that is forwarded to the - backend service. By default, the HTTP request path - will be trimmed from the left when forwarded to the - component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` - trimmed to ``/list``. If this value is ``true``"" , - the path will remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # - Optional. The maximum amount of instances for this - component. Must be more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 - # Optional. Default value is 80. The average - target CPU utilization for the component. - } - }, - "min_instance_count": 0 # - Optional. The minimum amount of instances for this - component. Must be less than max_instance_count. - }, - "build_command": "str", # Optional. - An optional build command to run while building this - component from source. - "dockerfile_path": "str", # - Optional. The path to the Dockerfile relative to the root of - the repo. If set, it will be used to build this component. - Otherwise, App Platform will attempt to build it using - buildpacks. - "environment_slug": "str", # - Optional. An environment slug describing the type of this - app. For a full list, please refer to `the product - documentation - `_. - "envs": [ - { - "key": "str", # The - variable name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # - Optional. The value. If the type is ``SECRET``"" , - the value will be encrypted on first submission. On - following submissions, the encrypted value should be - used. - } - ], - "git": { - "branch": "str", # Optional. - The name of the branch to use. - "repo_clone_url": "str" # - Optional. The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. - The name of the branch to use. - "deploy_on_push": bool, # - Optional. Whether to automatically deploy new commits - made to the repo. - "repo": "str" # Optional. - The name of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # - Optional. Whether to automatically deploy new images. - Can only be used for images hosted in DOCR and can - only be used with an image tag, not a specific - digest. - }, - "digest": "str", # Optional. - The image digest. Cannot be specified if tag is provided. - "registry": "str", # - Optional. The registry name. Must be left empty for the - ``DOCR`` registry type. - "registry_credentials": - "str", # Optional. The credentials to be able to pull - the image. The value will be encrypted on first - submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type - ``GHCR``. - "registry_type": "str", # - Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". - "repository": "str", # - Optional. The repository name. - "tag": "latest" # Optional. - Default value is "latest". The repository tag. Defaults - to ``latest`` if not provided and no digest is provided. - Cannot be specified if digest is provided. - }, - "instance_count": 1, # Optional. - Default value is 1. The amount of instances that this - component should be scaled to. Default: 1. Must not be set if - autoscaling is used. - "instance_size_slug": - "apps-s-1vcpu-0.5gb", # Optional. Default value is - "apps-s-1vcpu-0.5gb". The instance size to use for this - component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: - "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and - "apps-d-8vcpu-32gb". - "log_destinations": { "datadog": { "api_key": "str", # Datadog API key. Required. @@ -64194,1240 +67279,509 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { - "basic_auth": { - "password": - "str", # Password for user defined in User. - Required. - "user": "str" - # Username to authenticate with. Required. - }, "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. - "index_name": "logs" - # Optional. Default value is "logs". The index name - to use for the logs. If not set, the default index - name is "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. - Must be unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An - optional path to the working directory to use for the build. - For Dockerfile builds, this will be used as the build - context. Must be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which - causes immediate shutdown. (Default 120). - } - } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this - static site. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this static - site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier - slug of the deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this - worker. - "source_commit_hash": "str" # Optional. The - commit hash of the repository that was used to build this worker. - } - ] - }, - "project_id": "str", # Optional. The ID of the project the app is - assigned to. This will be empty if there is a lookup failure. - "region": { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - }, - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ - { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } - } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. } }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # + Optional. The number of seconds to wait between selecting + a container instance for termination and issuing the TERM + signal. Selecting a container instance for termination + begins an asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "catchall_document": "str", # + Optional. The name of the document to use as the fallback for + any requests to documents that are not found when serving + this static site. Only 1 of ``catchall_document`` or + ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. + } + ], + "error_document": "404.html", # + Optional. Default value is "404.html". The name of the error + document to use when serving this static site. Default: + 404.html. If no such file exists within the built assets, App + Platform will supply one. + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ + "index_document": "index.html", # + Optional. Default value is "index.html". The name of the + index document to use when serving this static site. Default: + index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "output_dir": "str", # Optional. An + optional path to where the built assets will be located, + relative to the build context. If not set, App Platform will + automatically scan for these directory names: ``_static``"" , + ``dist``"" , ``public``"" , ``build``. + "routes": [ { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. + "path": "str", # + Optional. (Deprecated - Use Ingress Rules instead). + An HTTP path prefix. Paths must start with / and must + be unique across all components within an app. + "preserve_path_prefix": bool # Optional. An optional + flag to preserve the path that is forwarded to the + backend service. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` + trimmed to ``/list``. If this value is ``true``"" , + the path will remain ``/api/list``. } ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # + Optional. The maximum amount of instances for this + component. Must be more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 + # Optional. Default value is 80. The average + target CPU utilization for the component. + } }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "min_instance_count": 0 # + Optional. The minimum amount of instances for this + component. Must be less than max_instance_count. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. + "build_command": "str", # Optional. + An optional build command to run while building this + component from source. + "dockerfile_path": "str", # + Optional. The path to the Dockerfile relative to the root of + the repo. If set, it will be used to build this component. + Otherwise, App Platform will attempt to build it using + buildpacks. + "environment_slug": "str", # + Optional. An environment slug describing the type of this + app. For a full list, please refer to `the product + documentation + `_. + "envs": [ + { + "key": "str", # The + variable name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # + Optional. The value. If the type is ``SECRET``"" , + the value will be encrypted on first submission. On + following submissions, the encrypted value should be + used. } + ], + "git": { + "branch": "str", # Optional. + The name of the branch to use. + "repo_clone_url": "str" # + Optional. The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "github": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. + "gitlab": { + "branch": "str", # Optional. + The name of the branch to use. + "deploy_on_push": bool, # + Optional. Whether to automatically deploy new commits + made to the repo. + "repo": "str" # Optional. + The name of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. }, - "logtail": { - "token": "str" # Optional. - Logtail token. + "image": { + "deploy_on_push": { + "enabled": bool # + Optional. Whether to automatically deploy new images. + Can only be used for images hosted in DOCR and can + only be used with an image tag, not a specific + digest. + }, + "digest": "str", # Optional. + The image digest. Cannot be specified if tag is provided. + "registry": "str", # + Optional. The registry name. Must be left empty for the + ``DOCR`` registry type. + "registry_credentials": + "str", # Optional. The credentials to be able to pull + the image. The value will be encrypted on first + submission. On following submissions, the encrypted value + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * + "$username:$access_token" for registries of type + ``GHCR``. + "registry_type": "str", # + Optional. * DOCKER_HUB: The DockerHub container registry + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". + "repository": "str", # + Optional. The repository name. + "tag": "latest" # Optional. + Default value is "latest". The repository tag. Defaults + to ``latest`` if not provided and no digest is provided. + Cannot be specified if digest is provided. }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. + "instance_count": 1, # Optional. + Default value is 1. The amount of instances that this + component should be scaled to. Default: 1. Must not be set if + autoscaling is used. + "instance_size_slug": + "apps-s-1vcpu-0.5gb", # Optional. Default value is + "apps-s-1vcpu-0.5gb". The instance size to use for this + component. Default: ``apps-s-1vcpu-0.5gb``. Known values are: + "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and + "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # + Datadog API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "logtail": { + "token": "str" # + Optional. Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. + "basic_auth": { + "password": + "str", # Password for user defined in User. + Required. + "user": "str" + # Username to authenticate with. Required. + }, + "index_name": "logs" + # Optional. Default value is "logs". The index name + to use for the logs. If not set, the default index + name is "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "name": "str", # Optional. The name. + Must be unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An + optional path to the working directory to use for the build. + For Dockerfile builds, this will be used as the build + context. Must be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which + causes immediate shutdown. (Default 120). } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this + static site. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this static + site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier + slug of the deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this + worker. + "source_commit_hash": "str" # Optional. The + commit hash of the repository that was used to build this worker. } ] }, + "project_id": "str", # Optional. The ID of the project the app is + assigned to. This will be empty if there is a lookup failure. + "region": { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + }, "tier_slug": "str", # Optional. The current pricing tier slug of the app. "updated_at": "2020-02-20 00:00:00" # Optional. Time of the app's @@ -65446,10 +67800,14 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -65458,20 +67816,20 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_update_request( + _request = build_apps_update_request( id=id, content_type=content_type, json=_json, @@ -65479,18 +67837,21 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -65527,9 +67888,9 @@ def update(self, id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_logs_active_deployment( @@ -65542,6 +67903,7 @@ def get_logs_active_deployment( pod_connection_timeout: Optional[str] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Retrieve Active Deployment Logs. Retrieve the logs of the active deployment if one exists. The response will include links to @@ -65597,10 +67959,14 @@ def get_logs_active_deployment( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -65609,9 +67975,9 @@ def get_logs_active_deployment( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_get_logs_active_deployment_request( + _request = build_apps_get_logs_active_deployment_request( app_id=app_id, component_name=component_name, follow=follow, @@ -65620,18 +67986,21 @@ def get_logs_active_deployment( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -65668,14 +68037,15 @@ def get_logs_active_deployment( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_deployments( self, app_id: str, *, page: int = 1, per_page: int = 20, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List App Deployments. List all deployments of an app. @@ -65695,6 +68065,9 @@ def list_deployments( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "deployments": [ { "cause": "str", # Optional. What caused this deployment to @@ -65745,8 +68118,8 @@ def list_deployments( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -65777,8 +68150,8 @@ def list_deployments( "message_base": "str", # Optional. The base of a human-readable description of the step intended to be combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + example: ``message_base`` = "Building service" + ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -65810,8 +68183,12 @@ def list_deployments( } ], "spec": { + "name": "str", # The name of the app. Must be unique + across all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if @@ -65821,11 +68198,9 @@ def list_deployments( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. - Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* + Default value is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be - unique across all components within the same app. Required. "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The @@ -65843,22 +68218,22 @@ def list_deployments( ``"1.3"``. Known values are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an - app's live URL. Only one domain may be set as primary."n* + app's live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. - If the domain uses DigitalOcean DNS and you would like - App"nPlatform to automatically manage it for you, set this to - the name of the"ndomain on your account."n"nFor example, If - the domain you are adding is ``app.domain.com``"" , the - zone"ncould be ``domain.com``. + If the domain uses DigitalOcean DNS and you would like App + Platform to automatically manage it for you, set this to the + name of the domain on your account. For example, If the + domain you are adding is ``app.domain.com``"" , the zone + could be ``domain.com``. } ], "egress": { @@ -65868,6 +68243,8 @@ def list_deployments( }, "functions": [ { + "name": "str", # The name. Must be + unique across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -65952,13 +68329,13 @@ def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -65996,6 +68373,7 @@ def list_deployments( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -66006,8 +68384,11 @@ def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -66015,10 +68396,6 @@ def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -66029,8 +68406,6 @@ def list_deployments( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be - unique across all components within the same app. Required. "routes": [ { "path": "str", # @@ -66197,13 +68572,13 @@ def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -66257,15 +68632,15 @@ def list_deployments( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -66289,13 +68664,14 @@ def list_deployments( "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job - type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: - Indicates a job that runs before an app deployment."n* + type, will auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: + Indicates a job that runs before an app deployment. * POST_DEPLOY: Indicates a job that runs after an app - deployment."n* FAILED_DEPLOY: Indicates a job that runs after + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -66306,8 +68682,11 @@ def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -66315,10 +68694,6 @@ def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -66345,8 +68720,6 @@ def list_deployments( } } ], - "name": "str", # The name of the app. Must be unique - across all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", @@ -66434,13 +68807,13 @@ def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -66504,9 +68877,9 @@ def list_deployments( }, "http_port": 0, # Optional. The internal port on which this service's run command will - listen. Default: 8080"nIf there is not an environment - variable with the name ``PORT``"" , one will be automatically - added with its value set to the value of this field. + listen. Default: 8080 If there is not an environment variable + with the name ``PORT``"" , one will be automatically added + with its value set to the value of this field. "image": { "deploy_on_push": { "enabled": bool # @@ -66524,15 +68897,15 @@ def list_deployments( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -66559,6 +68932,7 @@ def list_deployments( which this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -66569,8 +68943,11 @@ def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -66578,10 +68955,6 @@ def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -66703,13 +69076,13 @@ def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -66768,15 +69141,15 @@ def list_deployments( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -66789,6 +69162,7 @@ def list_deployments( index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -66799,8 +69173,11 @@ def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -66808,10 +69185,6 @@ def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -66890,13 +69263,13 @@ def list_deployments( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only - at run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at + at run-time * BUILD_TIME: Made available only at + build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # @@ -66950,15 +69323,15 @@ def list_deployments( "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value - should be used."n"n"n* "$username:$access_token" for - registries of type ``DOCKER_HUB``."n* + should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" for registries of type ``GHCR``. "registry_type": "str", # Optional. * DOCKER_HUB: The DockerHub container registry - type."n* DOCR: The DigitalOcean container registry - type."n* GHCR: The Github container registry type. Known - values are: "DOCKER_HUB", "DOCR", and "GHCR". + type. * DOCR: The DigitalOcean container registry type. * + GHCR: The Github container registry type. Known values + are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The repository name. "tag": "latest" # Optional. @@ -66981,6 +69354,7 @@ def list_deployments( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -66991,8 +69365,11 @@ def list_deployments( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. + Format: :code:``::code:``. Default port + is 9300. Required. "basic_auth": { "password": "str", # Password for user defined in User. @@ -67000,10 +69377,6 @@ def list_deployments( "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. - Format: :code:``::code:``. Default port - is 9300. Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index @@ -67056,9 +69429,6 @@ def list_deployments( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -67073,10 +69443,14 @@ def list_deployments( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -67085,27 +69459,30 @@ def list_deployments( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_list_deployments_request( + _request = build_apps_list_deployments_request( app_id=app_id, page=page, per_page=per_page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -67142,9 +69519,9 @@ def list_deployments( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_deployment( @@ -67155,6 +69532,7 @@ def create_deployment( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create an App Deployment. Creating an app deployment will pull the latest changes from your repository and schedule a new @@ -67226,9 +69604,8 @@ def create_deployment( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -67257,9 +69634,8 @@ def create_deployment( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -67289,8 +69665,12 @@ def create_deployment( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -67300,10 +69680,8 @@ def create_deployment( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -67321,21 +69699,21 @@ def create_deployment( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -67346,6 +69724,8 @@ def create_deployment( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -67423,13 +69803,894 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "ingress": { + "rules": [ + { + "component": { + "name": "str", # The name of + the component to route to. Required. + "preserve_path_prefix": + "str", # Optional. An optional flag to preserve the path + that is forwarded to the backend service. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. Note: this is not applicable for + Functions Components and is mutually exclusive with + ``rewrite``. + "rewrite": "str" # Optional. + An optional field that will rewrite the path of the + component to be what is specified here. By default, the + HTTP request path will be trimmed from the left when + forwarded to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If you specified the rewrite to be + ``/v1/``"" , requests to ``/api/list`` would be rewritten + to ``/v1/list``. Note: this is mutually exclusive with + ``preserve_path_prefix``. + }, + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to + the client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. + The set of allowed HTTP request headers. This + configures the ``Access-Control-Allow-Headers`` + header. + ], + "allow_methods": [ + "str" # Optional. + The set of allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": + "str", # Optional. Exact string match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "prefix": + "str", # Optional. Prefix-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. + "regex": + "str" # Optional. RE2 style regex-based match. + Only 1 of ``exact``"" , ``prefix``"" , or + ``regex`` must be set. For more information about + RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. + The set of HTTP response headers that browsers are + allowed to access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. + An optional duration specifying how long browsers can + cache the results of a preflight request. This configures + the ``Access-Control-Max-Age`` header. + }, + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such + as ``/api/v1/endpoint``. Required. + } + }, + "redirect": { + "authority": "str", # + Optional. The authority/host to redirect to. This can be + a hostname or IP address. Note: use ``port`` to set the + port. + "port": 0, # Optional. The + port to redirect to. + "redirect_code": 0, # + Optional. The redirect code to use. Defaults to ``302``. + Supported values are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. + The scheme to redirect to. Supported values are ``http`` + or ``https``. Default: ``https``. + "uri": "str" # Optional. An + optional URI path to redirect to. Note: if this is + specified the whole URI of the original request will be + overwritten to this value, irrespective of the original + request URI being matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the + geographical origin of the app. Default: ``nearest available``. Known + values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and + "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. + The number of failed health checks before considered + unhealthy. + "http_path": "str", # Optional. The + route path used for the HTTP health check ping. If not set, + the HTTP health check will be disabled and a TCP health check + used instead. + "initial_delay_seconds": 0, # + Optional. The number of seconds to wait before beginning + health checks. + "period_seconds": 0, # Optional. The + number of seconds to wait between health checks. + "port": 0, # Optional. The port on + which the health check will be performed. If not set, the + health check will be performed on the component's http_port. + "success_threshold": 0, # Optional. + The number of successful health checks before considered + healthy. + "timeout_seconds": 0 # Optional. The + number of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal + port on which this service's run command will listen. Default: + 8080 If there is not an environment variable with the name + ``PORT``"" , one will be automatically added with its value set + to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "output_dir": "str", # Optional. An optional + path to where the built assets will be located, relative to the + build context. If not set, App Platform will automatically scan + for these directory names: ``_static``"" , ``dist``"" , + ``public``"" , ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str" # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. + The maximum amount of instances for this component. Must be + more than min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # + Optional. Default value is 80. The average target CPU + utilization for the component. + } + }, + "min_instance_count": 0 # Optional. + The minimum amount of instances for this component. Must be + less than max_instance_count. + }, + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -67463,7 +70724,50 @@ def create_deployment( of the repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -67474,18 +70778,415 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ] + }, + "static_sites": [ + { + "name": "str", # Optional. The name of this static + site. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this static site. + } + ], + "tier_slug": "str", # Optional. The current pricing tier slug of the + deployment. + "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment + was last updated. + "workers": [ + { + "name": "str", # Optional. The name of this worker. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this worker. + } + ] + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def create_deployment( + self, + app_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create an App Deployment. + + Creating an app deployment will pull the latest changes from your repository and schedule a new + deployment for your app. + + :param app_id: The app ID. Required. + :type app_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deployment": { + "cause": "str", # Optional. What caused this deployment to be + created. + "cloned_from": "str", # Optional. The ID of a previous deployment + that this deployment was cloned from. + "created_at": "2020-02-20 00:00:00", # Optional. The creation time + of the deployment. + "functions": [ + { + "name": "str", # Optional. The name of this + functions component. + "namespace": "str", # Optional. The namespace where + the functions are deployed. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this functions + component. + } + ], + "id": "str", # Optional. The ID of the deployment. + "jobs": [ + { + "name": "str", # Optional. The name of this job. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this job. + } + ], + "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known + values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", + "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". + "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the + deployment phase was last updated. + "progress": { + "error_steps": 0, # Optional. Number of unsuccessful steps. + "pending_steps": 0, # Optional. Number of pending steps. + "running_steps": 0, # Optional. Number of currently running + steps. + "steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "success_steps": 0, # Optional. Number of successful steps. + "summary_steps": [ + { + "component_name": "str", # Optional. The + component name that this step is associated with. + "ended_at": "2020-02-20 00:00:00", # + Optional. The end time of this step. + "message_base": "str", # Optional. The base + of a human-readable description of the step intended to be + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". + "name": "str", # Optional. The name of this + step. + "reason": { + "code": "str", # Optional. The error + code. + "message": "str" # Optional. The + error message. + }, + "started_at": "2020-02-20 00:00:00", # + Optional. The start time of this step. + "status": "UNKNOWN", # Optional. Default + value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", + "RUNNING", "ERROR", and "SUCCESS". + "steps": [ + {} # Optional. Child steps of this + step. + ] + } + ], + "total_steps": 0 # Optional. Total number of steps. + }, + "services": [ + { + "name": "str", # Optional. The name of this service. + "source_commit_hash": "str" # Optional. The commit + hash of the repository that was used to build this service. + } + ], + "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "cluster_name": "str", # Optional. The name + of the underlying DigitalOcean DBaaS cluster. This is required + for production databases. For dev databases, if cluster_name is + not set, a new cluster will be provisioned. + "db_name": "str", # Optional. The name of + the MySQL or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of + the MySQL or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this + is a production or dev database. + "version": "str" # Optional. The version of + the database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the + domain. Required. + "minimum_tls_version": "str", # Optional. + The minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values + are: "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default + value is "UNSPECIFIED". * DEFAULT: The default + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: + The primary domain for this app that is displayed as the default + in the control panel, used in bindable environment variables, and + any other places that reference an app's live URL. Only one + domain may be set as primary. * ALIAS: A non-primary domain. + Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and + "ALIAS". + "wildcard": bool, # Optional. Indicates + whether the domain includes all sub-domains, in addition to the + given domain. + "zone": "str" # Optional. Optional. If the + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be + ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique + across all components within the same app. Required. + "alerts": [ + { + "disabled": bool, # + Optional. Is the alert disabled?. + "operator": + "UNSPECIFIED_OPERATOR", # Optional. Default value is + "UNSPECIFIED_OPERATOR". Known values are: + "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". + "rule": "UNSPECIFIED_RULE", + # Optional. Default value is "UNSPECIFIED_RULE". Known + values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", + "FUNCTIONS_ERROR_COUNT", and + "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. + Threshold value for alert. + "window": + "UNSPECIFIED_WINDOW" # Optional. Default value is + "UNSPECIFIED_WINDOW". Known values are: + "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { "endpoint": "str", # OpenSearch API Endpoint. Only HTTPS is supported. Format: :code:``::code:``. Default port is 9300. Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -67496,8 +71197,6 @@ def create_deployment( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -67658,13 +71357,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -67713,13 +71412,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -67742,13 +71441,14 @@ def create_deployment( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -67759,18 +71459,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -67797,8 +71496,6 @@ def create_deployment( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -67880,13 +71577,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -67944,7 +71641,7 @@ def create_deployment( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -67962,13 +71659,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -67994,6 +71691,7 @@ def create_deployment( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -68004,18 +71702,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -68130,13 +71827,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -68190,13 +71887,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -68210,6 +71907,7 @@ def create_deployment( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -68220,18 +71918,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -68308,13 +72005,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -68363,13 +72060,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -68391,6 +72088,7 @@ def create_deployment( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -68401,18 +72099,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -68474,15 +72171,11 @@ def create_deployment( } """ - @overload + @distributed_trace def create_deployment( - self, - app_id: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any, + self, app_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create an App Deployment. Creating an app deployment will pull the latest changes from your repository and schedule a new @@ -68490,11 +72183,8 @@ def create_deployment( :param app_id: The app ID. Required. :type app_id: str - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -68502,6 +72192,12 @@ def create_deployment( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "force_build": bool # Optional. Indicates whether to force a build of app + from source even if an existing cached build is suitable for re-use. + } + # response body for status code(s): 200 response == { "deployment": { @@ -68548,9 +72244,8 @@ def create_deployment( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -68579,9 +72274,8 @@ def create_deployment( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -68611,8 +72305,12 @@ def create_deployment( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -68622,10 +72320,8 @@ def create_deployment( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -68643,21 +72339,21 @@ def create_deployment( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -68668,6 +72364,8 @@ def create_deployment( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -68745,13 +72443,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -68786,6 +72484,7 @@ def create_deployment( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -68796,18 +72495,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -68818,8 +72516,6 @@ def create_deployment( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -68980,13 +72676,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -69035,13 +72731,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -69064,13 +72760,14 @@ def create_deployment( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -69081,18 +72778,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -69119,8 +72815,6 @@ def create_deployment( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -69202,13 +72896,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -69266,7 +72960,7 @@ def create_deployment( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -69284,13 +72978,241 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * + "$username:$access_token" for registries of type + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. + "registry_type": "str", # Optional. + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", + "DOCR", and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default + value is "latest". The repository tag. Defaults to ``latest`` + if not provided and no digest is provided. Cannot be + specified if digest is provided. + }, + "instance_count": 1, # Optional. Default + value is 1. The amount of instances that this component should be + scaled to. Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", + # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance + size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. + Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which + this service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog + API key. Required. + "endpoint": "str" # + Optional. Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. + Logtail token. + }, + "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # + Username to authenticate with. Required. + }, + "index_name": "logs" # + Optional. Default value is "logs". The index name to use + for the logs. If not set, the default index name is + "logs". + }, + "papertrail": { + "endpoint": "str" # + Papertrail syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be + unique across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across + all components within an app. + "preserve_path_prefix": bool + # Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded + to the component. For example, a component with + ``path=/api`` will have requests to ``/api/list`` trimmed + to ``/list``. If this value is ``true``"" , the path will + remain ``/api/list``. + } + ], + "run_command": "str", # Optional. An + optional run command to override the component's default. + "source_dir": "str", # Optional. An optional + path to the working directory to use for the build. For + Dockerfile builds, this will be used as the build context. Must + be relative to the root of the repo. + "termination": { + "drain_seconds": 0, # Optional. The + number of seconds to wait between selecting a container + instance for termination and issuing the TERM signal. + Selecting a container instance for termination begins an + asynchronous drain of new requests on upstream + load-balancers. (Default 15). + "grace_period_seconds": 0 # + Optional. The number of seconds to wait between sending a + TERM signal to a container and issuing a KILL which causes + immediate shutdown. (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An + optional build command to run while building this component from + source. + "catchall_document": "str", # Optional. The + name of the document to use as the fallback for any requests to + documents that are not found when serving this static site. Only + 1 of ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # + Optional. Whether browsers should expose the response to the + client-side JavaScript code when the request"u2019s + credentials mode is include. This configures the + ``Access-Control-Allow-Credentials`` header. + "allow_headers": [ + "str" # Optional. The set of + allowed HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of + allowed HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # + Optional. Exact string match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "prefix": "str", # + Optional. Prefix-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. + "regex": "str" # + Optional. RE2 style regex-based match. Only 1 of + ``exact``"" , ``prefix``"" , or ``regex`` must be + set. For more information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of + HTTP response headers that browsers are allowed to + access. This configures the + ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An + optional duration specifying how long browsers can cache the + results of a preflight request. This configures the + ``Access-Control-Max-Age`` header. + }, + "dockerfile_path": "str", # Optional. The + path to the Dockerfile relative to the root of the repo. If set, + it will be used to build this component. Otherwise, App Platform + will attempt to build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full + list, please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable + name. Required. + "scope": + "RUN_AND_BUILD_TIME", # Optional. Default value is + "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # + Optional. Default value is "GENERAL". * GENERAL: A + plain-text environment variable * SECRET: A secret + encrypted environment variable. Known values are: + "GENERAL" and "SECRET". + "value": "str" # Optional. + The value. If the type is ``SECRET``"" , the value will + be encrypted on first submission. On following + submissions, the encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. + Default value is "404.html". The name of the error document to + use when serving this static site. Default: 404.html. If no such + file exists within the built assets, App Platform will supply + one. + "git": { + "branch": "str", # Optional. The + name of the branch to use. + "repo_clone_url": "str" # Optional. + The clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The + name of the branch to use. + "deploy_on_push": bool, # Optional. + Whether to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name + of the repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. + Whether to automatically deploy new images. Can only be + used for images hosted in DOCR and can only be used with + an image tag, not a specific digest. + }, + "digest": "str", # Optional. The + image digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The + registry name. Must be left empty for the ``DOCR`` registry + type. + "registry_credentials": "str", # + Optional. The credentials to be able to pull the image. The + value will be encrypted on first submission. On following + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -69300,22 +73222,11 @@ def create_deployment( if not provided and no digest is provided. Cannot be specified if digest is provided. }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], + "index_document": "index.html", # Optional. + Default value is "index.html". The name of the index document to + use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -69326,234 +73237,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, "endpoint": "str", # OpenSearch API Endpoint. Only HTTPS is supported. Format: :code:``::code:``. Default port is 9300. Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). - } - } - ], - "static_sites": [ - { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -69630,13 +73324,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -69685,13 +73379,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -69713,6 +73407,7 @@ def create_deployment( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -69723,18 +73418,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -69795,23 +73489,109 @@ def create_deployment( tickets to help identify the issue. } """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_apps_create_deployment_request( + app_id=app_id, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore @distributed_trace - def create_deployment( - self, app_id: str, body: Union[JSON, IO], **kwargs: Any - ) -> JSON: - """Create an App Deployment. + def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an App Deployment. - Creating an app deployment will pull the latest changes from your repository and schedule a new - deployment for your app. + Retrieve information about an app deployment. :param app_id: The app ID. Required. :type app_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param deployment_id: The deployment ID. Required. + :type deployment_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -69865,9 +73645,8 @@ def create_deployment( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -69896,9 +73675,8 @@ def create_deployment( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -69928,8 +73706,12 @@ def create_deployment( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -69939,10 +73721,8 @@ def create_deployment( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -69960,21 +73740,21 @@ def create_deployment( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -69985,6 +73765,8 @@ def create_deployment( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -70062,13 +73844,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -70103,6 +73885,7 @@ def create_deployment( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -70113,18 +73896,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -70135,8 +73917,6 @@ def create_deployment( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -70297,13 +74077,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -70352,13 +74132,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -70381,13 +74161,14 @@ def create_deployment( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -70398,18 +74179,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -70436,8 +74216,6 @@ def create_deployment( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -70519,13 +74297,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -70583,7 +74361,7 @@ def create_deployment( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -70601,13 +74379,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -70633,6 +74411,7 @@ def create_deployment( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -70643,18 +74422,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -70769,13 +74547,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -70829,13 +74607,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -70849,6 +74627,7 @@ def create_deployment( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -70859,18 +74638,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -70947,13 +74725,13 @@ def create_deployment( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -71002,13 +74780,13 @@ def create_deployment( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -71030,6 +74808,7 @@ def create_deployment( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -71040,18 +74819,17 @@ def create_deployment( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -71112,51 +74890,45 @@ def create_deployment( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_apps_create_deployment_request( + _request = build_apps_get_deployment_request( app_id=app_id, - content_type=content_type, - json=_json, - content=_content, + deployment_id=deployment_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -71193,15 +74965,16 @@ def create_deployment( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON: - """Retrieve an App Deployment. + def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Cancel a Deployment. - Retrieve information about an app deployment. + Immediately cancel an in-progress deployment. :param app_id: The app ID. Required. :type app_id: str @@ -71260,9 +75033,8 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -71291,9 +75063,8 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -71323,8 +75094,12 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -71334,10 +75109,8 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -71355,21 +75128,21 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -71380,6 +75153,8 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -71457,13 +75232,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -71498,6 +75273,7 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -71508,18 +75284,17 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -71530,8 +75305,6 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -71692,13 +75465,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -71747,13 +75520,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -71776,13 +75549,14 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -71793,18 +75567,17 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -71831,8 +75604,6 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -71914,13 +75685,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -71978,7 +75749,7 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -71996,13 +75767,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -72028,6 +75799,7 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -72038,18 +75810,17 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -72164,13 +75935,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -72224,13 +75995,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -72244,6 +76015,7 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -72254,18 +76026,17 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -72342,13 +76113,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -72397,13 +76168,13 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -72425,6 +76196,7 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -72435,18 +76207,17 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -72507,10 +76278,14 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -72519,26 +76294,180 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_get_deployment_request( + _request = build_apps_cancel_deployment_request( app_id=app_id, deployment_id=deployment_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_logs( + self, + app_id: str, + deployment_id: str, + component_name: str, + *, + follow: Optional[bool] = None, + type: str = "UNSPECIFIED", + pod_connection_timeout: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Deployment Logs. + + Retrieve the logs of a past, in-progress, or active deployment. The response will include links + to either real-time logs of an in-progress or active deployment or archived logs of a past + deployment. + + :param app_id: The app ID. Required. + :type app_id: str + :param deployment_id: The deployment ID. Required. + :type deployment_id: str + :param component_name: An optional component name. If set, logs will be limited to this + component only. Required. + :type component_name: str + :keyword follow: Whether the logs should follow live updates. Default value is None. + :paramtype follow: bool + :keyword type: The type of logs to retrieve + + + * BUILD: Build-time logs + * DEPLOY: Deploy-time logs + * RUN: Live run-time logs + * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: + "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". + :paramtype type: str + :keyword pod_connection_timeout: An optional time duration to wait if the underlying component + instance is not immediately available. Default: ``3m``. Default value is None. + :paramtype pod_connection_timeout: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "historic_urls": [ + "str" # Optional. A list of URLs to archived log files. + ], + "live_url": "str" # Optional. A URL of the real-time live logs. This URL may + use either the ``https://`` or ``wss://`` protocols and will keep pushing live + logs as they become available. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_logs_request( + app_id=app_id, + deployment_id=deployment_id, + component_name=component_name, + follow=follow, + type=type, + pod_connection_timeout=pod_connection_timeout, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -72575,20 +76504,872 @@ def get_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace - def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> JSON: - """Cancel a Deployment. + def get_logs_aggregate( + self, + app_id: str, + deployment_id: str, + *, + follow: Optional[bool] = None, + type: str = "UNSPECIFIED", + pod_connection_timeout: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Aggregate Deployment Logs. - Immediately cancel an in-progress deployment. + Retrieve the logs of a past, in-progress, or active deployment. If a component name is + specified, the logs will be limited to only that component. The response will include links to + either real-time logs of an in-progress or active deployment or archived logs of a past + deployment. + + :param app_id: The app ID. Required. + :type app_id: str + :param deployment_id: The deployment ID. Required. + :type deployment_id: str + :keyword follow: Whether the logs should follow live updates. Default value is None. + :paramtype follow: bool + :keyword type: The type of logs to retrieve + + + * BUILD: Build-time logs + * DEPLOY: Deploy-time logs + * RUN: Live run-time logs + * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: + "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". + :paramtype type: str + :keyword pod_connection_timeout: An optional time duration to wait if the underlying component + instance is not immediately available. Default: ``3m``. Default value is None. + :paramtype pod_connection_timeout: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "historic_urls": [ + "str" # Optional. A list of URLs to archived log files. + ], + "live_url": "str" # Optional. A URL of the real-time live logs. This URL may + use either the ``https://`` or ``wss://`` protocols and will keep pushing live + logs as they become available. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_logs_aggregate_request( + app_id=app_id, + deployment_id=deployment_id, + follow=follow, + type=type, + pod_connection_timeout=pod_connection_timeout, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_logs_active_deployment_aggregate( + self, + app_id: str, + *, + follow: Optional[bool] = None, + type: str = "UNSPECIFIED", + pod_connection_timeout: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Retrieve Active Deployment Aggregate Logs. + + Retrieve the logs of the active deployment if one exists. The response will include links to + either real-time logs of an in-progress or active deployment or archived logs of a past + deployment. Note log_type=BUILD logs will return logs associated with the current active + deployment (being served). To view build logs associated with in-progress build, the query must + explicitly reference the deployment id. + + :param app_id: The app ID. Required. + :type app_id: str + :keyword follow: Whether the logs should follow live updates. Default value is None. + :paramtype follow: bool + :keyword type: The type of logs to retrieve + + + * BUILD: Build-time logs + * DEPLOY: Deploy-time logs + * RUN: Live run-time logs + * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: + "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". + :paramtype type: str + :keyword pod_connection_timeout: An optional time duration to wait if the underlying component + instance is not immediately available. Default: ``3m``. Default value is None. + :paramtype pod_connection_timeout: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "historic_urls": [ + "str" # Optional. A list of URLs to archived log files. + ], + "live_url": "str" # Optional. A URL of the real-time live logs. This URL may + use either the ``https://`` or ``wss://`` protocols and will keep pushing live + logs as they become available. + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_logs_active_deployment_aggregate_request( + app_id=app_id, + follow=follow, + type=type, + pod_connection_timeout=pod_connection_timeout, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_tiers(self, **kwargs: Any) -> JSON: + """List App Tiers. + + List all app tiers. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "tiers": [ + { + "build_seconds": "str", # Optional. The amount of included + build time in seconds. + "egress_bandwidth_bytes": "str", # Optional. The amount of + included outbound bandwidth in bytes. + "name": "str", # Optional. A human-readable name of the + tier. + "slug": "str", # Optional. The slug of the tier. + "storage_bytes": "str" # Optional. The allotted disk space + in bytes. + } + ] + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_list_tiers_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_tier(self, slug: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an App Tier. + + Retrieve information about a specific app tier. + + :param slug: The slug of the tier. Required. + :type slug: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "tier": { + "build_seconds": "str", # Optional. The amount of included build + time in seconds. + "egress_bandwidth_bytes": "str", # Optional. The amount of included + outbound bandwidth in bytes. + "name": "str", # Optional. A human-readable name of the tier. + "slug": "str", # Optional. The slug of the tier. + "storage_bytes": "str" # Optional. The allotted disk space in bytes. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_tier_request( + slug=slug, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_instance_sizes(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """List Instance Sizes. + + List all instance sizes for ``service``\\ , ``worker``\\ , and ``job`` components. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "discount_percent": 0.0, # Optional. + "instance_sizes": [ + { + "bandwidth_allowance_gib": "str", # Optional. The bandwidth + allowance in GiB for the instance size. + "cpu_type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * SHARED: Shared vCPU cores * DEDICATED: Dedicated vCPU + cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED". + "cpus": "str", # Optional. The number of allotted vCPU + cores. + "deprecation_intent": bool, # Optional. Indicates if the + instance size is intended for deprecation. + "memory_bytes": "str", # Optional. The allotted memory in + bytes. + "name": "str", # Optional. A human-readable name of the + instance size. + "scalable": bool, # Optional. Indicates if the instance size + can enable autoscaling. + "single_instance_only": bool, # Optional. Indicates if the + instance size allows more than one instance. + "slug": "str", # Optional. The slug of the instance size. + "tier_downgrade_to": "str", # Optional. The slug of the + corresponding downgradable instance size on the lower tier. + "tier_slug": "str", # Optional. The slug of the tier to + which this instance size belongs. + "tier_upgrade_to": "str", # Optional. The slug of the + corresponding upgradable instance size on the higher tier. + "usd_per_month": "str", # Optional. The cost of this + instance size in USD per month. + "usd_per_second": "str" # Optional. The cost of this + instance size in USD per second. + } + ] + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_list_instance_sizes_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_instance_size(self, slug: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Retrieve an Instance Size. + + Retrieve information about a specific instance size for ``service``\\ , ``worker``\\ , and + ``job`` components. + + :param slug: The slug of the instance size. Required. + :type slug: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "instance_size": { + "bandwidth_allowance_gib": "str", # Optional. The bandwidth + allowance in GiB for the instance size. + "cpu_type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * SHARED: Shared vCPU cores * DEDICATED: Dedicated vCPU + cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED". + "cpus": "str", # Optional. The number of allotted vCPU cores. + "deprecation_intent": bool, # Optional. Indicates if the instance + size is intended for deprecation. + "memory_bytes": "str", # Optional. The allotted memory in bytes. + "name": "str", # Optional. A human-readable name of the instance + size. + "scalable": bool, # Optional. Indicates if the instance size can + enable autoscaling. + "single_instance_only": bool, # Optional. Indicates if the instance + size allows more than one instance. + "slug": "str", # Optional. The slug of the instance size. + "tier_downgrade_to": "str", # Optional. The slug of the + corresponding downgradable instance size on the lower tier. + "tier_slug": "str", # Optional. The slug of the tier to which this + instance size belongs. + "tier_upgrade_to": "str", # Optional. The slug of the corresponding + upgradable instance size on the higher tier. + "usd_per_month": "str", # Optional. The cost of this instance size + in USD per month. + "usd_per_second": "str" # Optional. The cost of this instance size + in USD per second. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_get_instance_size_request( + slug=slug, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_regions(self, **kwargs: Any) -> JSON: + """List App Regions. + + List all regions supported by App Platform. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "regions": [ + { + "continent": "str", # Optional. The continent that this + region is in. + "data_centers": [ + "str" # Optional. Data centers that are in this + region. + ], + "default": bool, # Optional. Whether or not the region is + presented as the default. + "disabled": bool, # Optional. Whether or not the region is + open for new apps. + "flag": "str", # Optional. The flag of this region. + "label": "str", # Optional. A human-readable name of the + region. + "reason": "str", # Optional. Reason that this region is not + available. + "slug": "str" # Optional. The slug form of the region name. + } + ] + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_apps_list_regions_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def validate_app_spec( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Propose an App Spec. + + To propose and validate a spec for a new or existing app, send a POST request to the + ``/v2/apps/propose`` endpoint. The request returns some information about the proposed app, + including app cost and upgrade cost. If an existing app ID is specified, the app spec is + treated as a proposed update to the existing app. - :param app_id: The app ID. Required. - :type app_id: str - :param deployment_id: The deployment ID. Required. - :type deployment_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -72596,899 +77377,258 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "deployment": { - "cause": "str", # Optional. What caused this deployment to be - created. - "cloned_from": "str", # Optional. The ID of a previous deployment - that this deployment was cloned from. - "created_at": "2020-02-20 00:00:00", # Optional. The creation time - of the deployment. - "functions": [ + # JSON input template you can fill out and use as your body input. + body = { + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ { - "name": "str", # Optional. The name of this - functions component. - "namespace": "str", # Optional. The namespace where - the functions are deployed. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this functions - component. + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. } ], - "id": "str", # Optional. The ID of the deployment. - "jobs": [ + "domains": [ { - "name": "str", # Optional. The name of this job. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this job. + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], - "phase": "UNKNOWN", # Optional. Default value is "UNKNOWN". Known - values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY", - "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED". - "phase_last_updated_at": "2020-02-20 00:00:00", # Optional. When the - deployment phase was last updated. - "progress": { - "error_steps": 0, # Optional. Number of unsuccessful steps. - "pending_steps": 0, # Optional. Number of pending steps. - "running_steps": 0, # Optional. Number of currently running - steps. - "steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] - } - ], - "success_steps": 0, # Optional. Number of successful steps. - "summary_steps": [ - { - "component_name": "str", # Optional. The - component name that this step is associated with. - "ended_at": "2020-02-20 00:00:00", # - Optional. The end time of this step. - "message_base": "str", # Optional. The base - of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". - "name": "str", # Optional. The name of this - step. - "reason": { - "code": "str", # Optional. The error - code. - "message": "str" # Optional. The - error message. - }, - "started_at": "2020-02-20 00:00:00", # - Optional. The start time of this step. - "status": "UNKNOWN", # Optional. Default - value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING", - "RUNNING", "ERROR", and "SUCCESS". - "steps": [ - {} # Optional. Child steps of this - step. - ] - } - ], - "total_steps": 0 # Optional. Total number of steps. + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". }, - "services": [ + "functions": [ { - "name": "str", # Optional. The name of this service. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this service. - } - ], - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name - of the underlying DigitalOcean DBaaS cluster. This is required - for production databases. For dev databases, if cluster_name is - not set, a new cluster will be provisioned. - "db_name": "str", # Optional. The name of - the MySQL or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of - the MySQL or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "production": bool, # Optional. Whether this - is a production or dev database. - "version": "str" # Optional. The version of - the database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the - domain. Required. - "minimum_tls_version": "str", # Optional. - The minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values - are: "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: - The primary domain for this app that is displayed as the default - in the control panel, used in bindable environment variables, and - any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. - Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and - "ALIAS". - "wildcard": bool, # Optional. Indicates - whether the domain includes all sub-domains, in addition to the - given domain. - "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be - ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # - Optional. Is the alert disabled?. - "operator": - "UNSPECIFIED_OPERATOR", # Optional. Default value is - "UNSPECIFIED_OPERATOR". Known values are: - "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN". - "rule": "UNSPECIFIED_RULE", - # Optional. Default value is "UNSPECIFIED_RULE". Known - values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", - "FUNCTIONS_ERROR_COUNT", and - "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. - Threshold value for alert. - "window": - "UNSPECIFIED_WINDOW" # Optional. Default value is - "UNSPECIFIED_WINDOW". Known values are: - "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ + { + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. ], - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. - "routes": [ + "allow_origins": [ { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "ingress": { - "rules": [ + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ { - "component": { - "name": "str", # The name of - the component to route to. Required. - "preserve_path_prefix": - "str", # Optional. An optional flag to preserve the path - that is forwarded to the backend service. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. Note: this is not applicable for - Functions Components and is mutually exclusive with - ``rewrite``. - "rewrite": "str" # Optional. - An optional field that will rewrite the path of the - component to be what is specified here. By default, the - HTTP request path will be trimmed from the left when - forwarded to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If you specified the rewrite to be - ``/v1/``"" , requests to ``/api/list`` would be rewritten - to ``/v1/list``. Note: this is mutually exclusive with - ``preserve_path_prefix``. - }, - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to - the client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. - The set of allowed HTTP request headers. This - configures the ``Access-Control-Allow-Headers`` - header. - ], - "allow_methods": [ - "str" # Optional. - The set of allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": - "str", # Optional. Exact string match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "prefix": - "str", # Optional. Prefix-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. - "regex": - "str" # Optional. RE2 style regex-based match. - Only 1 of ``exact``"" , ``prefix``"" , or - ``regex`` must be set. For more information about - RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. - The set of HTTP response headers that browsers are - allowed to access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. - An optional duration specifying how long browsers can - cache the results of a preflight request. This configures - the ``Access-Control-Max-Age`` header. - }, - "match": { - "path": { - "prefix": "str" # - Prefix-based match. For example, ``/api`` will match - ``/api``"" , ``/api/``"" , and any nested paths such - as ``/api/v1/endpoint``. Required. - } - }, - "redirect": { - "authority": "str", # - Optional. The authority/host to redirect to. This can be - a hostname or IP address. Note: use ``port`` to set the - port. - "port": 0, # Optional. The - port to redirect to. - "redirect_code": 0, # - Optional. The redirect code to use. Defaults to ``302``. - Supported values are 300, 301, 302, 303, 304, 307, 308. - "scheme": "str", # Optional. - The scheme to redirect to. Supported values are ``http`` - or ``https``. Default: ``https``. - "uri": "str" # Optional. An - optional URI path to redirect to. Note: if this is - specified the whole URI of the original request will be - overwritten to this value, irrespective of the original - request URI being matched. - } + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. } - ] - }, - "jobs": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. + "logtail": { + "token": "str" # Optional. Logtail + token. }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "kind": "UNSPECIFIED", # Optional. Default - value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and - "FAILED_DEPLOY". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } - } - ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. - "region": "str", # Optional. The slug form of the - geographical origin of the app. Default: ``nearest available``. Known - values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and - "syd". - "services": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } - }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. - }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "cors": { - "allow_credentials": bool, # - Optional. Whether browsers should expose the response to the - client-side JavaScript code when the request"u2019s - credentials mode is include. This configures the - ``Access-Control-Allow-Credentials`` header. - "allow_headers": [ - "str" # Optional. The set of - allowed HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of - allowed HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # - Optional. Exact string match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "prefix": "str", # - Optional. Prefix-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. - "regex": "str" # - Optional. RE2 style regex-based match. Only 1 of - ``exact``"" , ``prefix``"" , or ``regex`` must be - set. For more information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of - HTTP response headers that browsers are allowed to - access. This configures the - ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An - optional duration specifying how long browsers can cache the - results of a preflight request. This configures the - ``Access-Control-Max-Age`` header. - }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "health_check": { - "failure_threshold": 0, # Optional. - The number of failed health checks before considered - unhealthy. - "http_path": "str", # Optional. The - route path used for the HTTP health check ping. If not set, - the HTTP health check will be disabled and a TCP health check - used instead. - "initial_delay_seconds": 0, # - Optional. The number of seconds to wait before beginning - health checks. - "period_seconds": 0, # Optional. The - number of seconds to wait between health checks. - "port": 0, # Optional. The port on - which the health check will be performed. If not set, the - health check will be performed on the component's http_port. - "success_threshold": 0, # Optional. - The number of successful health checks before considered - healthy. - "timeout_seconds": 0 # Optional. The - number of seconds after which the check times out. - }, - "http_port": 0, # Optional. The internal - port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name - ``PORT``"" , one will be automatically added with its value set - to the value of this field. - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. - }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "internal_ports": [ - 0 # Optional. The ports on which - this service will listen for internal traffic. - ], - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "routes": [ - { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. - } - ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "drain_seconds": 0, # Optional. The - number of seconds to wait between selecting a container - instance for termination and issuing the TERM signal. - Selecting a container instance for termination begins an - asynchronous drain of new requests on upstream - load-balancers. (Default 15). - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). + }, + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. } - } - ], - "static_sites": [ + ], + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "ingress": { + "rules": [ { - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "catchall_document": "str", # Optional. The - name of the document to use as the fallback for any requests to - documents that are not found when serving this static site. Only - 1 of ``catchall_document`` or ``error_document`` can be set. + "component": { + "name": "str", # The name of the + component to route to. Required. + "preserve_path_prefix": "str", # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. Note: this is not applicable for Functions + Components and is mutually exclusive with ``rewrite``. + "rewrite": "str" # Optional. An + optional field that will rewrite the path of the component to + be what is specified here. By default, the HTTP request path + will be trimmed from the left when forwarded to the + component. For example, a component with ``path=/api`` will + have requests to ``/api/list`` trimmed to ``/list``. If you + specified the rewrite to be ``/v1/``"" , requests to + ``/api/list`` would be rewritten to ``/v1/list``. Note: this + is mutually exclusive with ``preserve_path_prefix``. + }, "cors": { "allow_credentials": bool, # Optional. Whether browsers should expose the response to the @@ -73531,1401 +77671,844 @@ def cancel_deployment(self, app_id: str, deployment_id: str, **kwargs: Any) -> J results of a preflight request. This configures the ``Access-Control-Max-Age`` header. }, - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ - { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "match": { + "path": { + "prefix": "str" # + Prefix-based match. For example, ``/api`` will match + ``/api``"" , ``/api/``"" , and any nested paths such as + ``/api/v1/endpoint``. Required. } - ], - "error_document": "404.html", # Optional. - Default value is "404.html". The name of the error document to - use when serving this static site. Default: 404.html. If no such - file exists within the built assets, App Platform will supply - one. - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "redirect": { + "authority": "str", # Optional. The + authority/host to redirect to. This can be a hostname or IP + address. Note: use ``port`` to set the port. + "port": 0, # Optional. The port to + redirect to. + "redirect_code": 0, # Optional. The + redirect code to use. Defaults to ``302``. Supported values + are 300, 301, 302, 303, 304, 307, 308. + "scheme": "str", # Optional. The + scheme to redirect to. Supported values are ``http`` or + ``https``. Default: ``https``. + "uri": "str" # Optional. An optional + URI path to redirect to. Note: if this is specified the whole + URI of the original request will be overwritten to this + value, irrespective of the original request URI being + matched. + } + } + ] + }, + "jobs": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. + } }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. - }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "kind": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a + component fails to deploy. Known values are: "UNSPECIFIED", + "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. }, - "index_document": "index.html", # Optional. - Default value is "index.html". The name of the index document to - use when serving this static site. Default: index.html. - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "region": "str", # Optional. The slug form of the geographical + origin of the app. Default: ``nearest available``. Known values are: "ams", + "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". + "services": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. } }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "output_dir": "str", # Optional. An optional - path to where the built assets will be located, relative to the - build context. If not set, App Platform will automatically scan - for these directory names: ``_static``"" , ``dist``"" , - ``public``"" , ``build``. - "routes": [ + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "path": "str", # Optional. - (Deprecated - Use Ingress Rules instead). An HTTP path - prefix. Paths must start with / and must be unique across - all components within an app. - "preserve_path_prefix": bool - # Optional. An optional flag to preserve the path that is - forwarded to the backend service. By default, the HTTP - request path will be trimmed from the left when forwarded - to the component. For example, a component with - ``path=/api`` will have requests to ``/api/list`` trimmed - to ``/list``. If this value is ``true``"" , the path will - remain ``/api/list``. + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str" # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - } - ], - "workers": [ - { - "autoscaling": { - "max_instance_count": 0, # Optional. - The maximum amount of instances for this component. Must be - more than min_instance_count. - "metrics": { - "cpu": { - "percent": 80 # - Optional. Default value is 80. The average target CPU - utilization for the component. - } + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "health_check": { + "failure_threshold": 0, # Optional. The + number of failed health checks before considered unhealthy. + "http_path": "str", # Optional. The route + path used for the HTTP health check ping. If not set, the HTTP + health check will be disabled and a TCP health check used + instead. + "initial_delay_seconds": 0, # Optional. The + number of seconds to wait before beginning health checks. + "period_seconds": 0, # Optional. The number + of seconds to wait between health checks. + "port": 0, # Optional. The port on which the + health check will be performed. If not set, the health check will + be performed on the component's http_port. + "success_threshold": 0, # Optional. The + number of successful health checks before considered healthy. + "timeout_seconds": 0 # Optional. The number + of seconds after which the check times out. + }, + "http_port": 0, # Optional. The internal port on + which this service's run command will listen. Default: 8080 If there + is not an environment variable with the name ``PORT``"" , one will be + automatically added with its value set to the value of this field. + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "internal_ports": [ + 0 # Optional. The ports on which this + service will listen for internal traffic. + ], + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "min_instance_count": 0 # Optional. - The minimum amount of instances for this component. Must be - less than max_instance_count. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". }, - "build_command": "str", # Optional. An - optional build command to run while building this component from - source. - "dockerfile_path": "str", # Optional. The - path to the Dockerfile relative to the root of the repo. If set, - it will be used to build this component. Otherwise, App Platform - will attempt to build it using buildpacks. - "environment_slug": "str", # Optional. An - environment slug describing the type of this app. For a full - list, please refer to `the product documentation - `_. - "envs": [ + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "drain_seconds": 0, # Optional. The number + of seconds to wait between selecting a container instance for + termination and issuing the TERM signal. Selecting a container + instance for termination begins an asynchronous drain of new + requests on upstream load-balancers. (Default 15). + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ], + "static_sites": [ + { + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "catchall_document": "str", # Optional. The name of + the document to use as the fallback for any requests to documents + that are not found when serving this static site. Only 1 of + ``catchall_document`` or ``error_document`` can be set. + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ { - "key": "str", # The variable - name. Required. - "scope": - "RUN_AND_BUILD_TIME", # Optional. Default value is - "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # - Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret - encrypted environment variable. Known values are: - "GENERAL" and "SECRET". - "value": "str" # Optional. - The value. If the type is ``SECRET``"" , the value will - be encrypted on first submission. On following - submissions, the encrypted value should be used. + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. } ], - "git": { - "branch": "str", # Optional. The - name of the branch to use. - "repo_clone_url": "str" # Optional. - The clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "error_document": "404.html", # Optional. Default + value is "404.html". The name of the error document to use when + serving this static site. Default: 404.html. If no such file exists + within the built assets, App Platform will supply one. + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. }, - "github": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "index_document": "index.html", # Optional. Default + value is "index.html". The name of the index document to use when + serving this static site. Default: index.html. + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. }, - "gitlab": { - "branch": "str", # Optional. The - name of the branch to use. - "deploy_on_push": bool, # Optional. - Whether to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name - of the repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. + "logtail": { + "token": "str" # Optional. Logtail + token. }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. - Whether to automatically deploy new images. Can only be - used for images hosted in DOCR and can only be used with - an image tag, not a specific digest. + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. }, - "digest": "str", # Optional. The - image digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The - registry name. Must be left empty for the ``DOCR`` registry - type. - "registry_credentials": "str", # - Optional. The credentials to be able to pull the image. The - value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* - "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. - "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", - "DOCR", and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default - value is "latest". The repository tag. Defaults to ``latest`` - if not provided and no digest is provided. Cannot be - specified if digest is provided. + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". }, - "instance_count": 1, # Optional. Default - value is 1. The amount of instances that this component should be - scaled to. Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", - # Optional. Default value is "apps-s-1vcpu-0.5gb". The instance - size to use for this component. Default: ``apps-s-1vcpu-0.5gb``. - Known values are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog - API key. Required. - "endpoint": "str" # - Optional. Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. - Logtail token. - }, - "name": "str", # Required. - "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # - Username to authenticate with. Required. - }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. - "index_name": "logs" # - Optional. Default value is "logs". The index name to use - for the logs. If not set, the default index name is - "logs". - }, - "papertrail": { - "endpoint": "str" # - Papertrail syslog endpoint. Required. + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "output_dir": "str", # Optional. An optional path to + where the built assets will be located, relative to the build + context. If not set, App Platform will automatically scan for these + directory names: ``_static``"" , ``dist``"" , ``public``"" , + ``build``. + "routes": [ + { + "path": "str", # Optional. + (Deprecated - Use Ingress Rules instead). An HTTP path + prefix. Paths must start with / and must be unique across all + components within an app. + "preserve_path_prefix": bool # + Optional. An optional flag to preserve the path that is + forwarded to the backend service. By default, the HTTP + request path will be trimmed from the left when forwarded to + the component. For example, a component with ``path=/api`` + will have requests to ``/api/list`` trimmed to ``/list``. If + this value is ``true``"" , the path will remain + ``/api/list``. + } + ], + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str" # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + } + ], + "workers": [ + { + "autoscaling": { + "max_instance_count": 0, # Optional. The + maximum amount of instances for this component. Must be more than + min_instance_count. + "metrics": { + "cpu": { + "percent": 80 # Optional. + Default value is 80. The average target CPU utilization + for the component. } }, - "name": "str", # Optional. The name. Must be - unique across all components within the same app. - "run_command": "str", # Optional. An - optional run command to override the component's default. - "source_dir": "str", # Optional. An optional - path to the working directory to use for the build. For - Dockerfile builds, this will be used as the build context. Must - be relative to the root of the repo. - "termination": { - "grace_period_seconds": 0 # - Optional. The number of seconds to wait between sending a - TERM signal to a container and issuing a KILL which causes - immediate shutdown. (Default 120). + "min_instance_count": 0 # Optional. The + minimum amount of instances for this component. Must be less than + max_instance_count. + }, + "build_command": "str", # Optional. An optional + build command to run while building this component from source. + "dockerfile_path": "str", # Optional. The path to + the Dockerfile relative to the root of the repo. If set, it will be + used to build this component. Otherwise, App Platform will attempt to + build it using buildpacks. + "environment_slug": "str", # Optional. An + environment slug describing the type of this app. For a full list, + please refer to `the product documentation + `_. + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). } - ] - }, - "static_sites": [ - { - "name": "str", # Optional. The name of this static - site. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this static site. - } - ], - "tier_slug": "str", # Optional. The current pricing tier slug of the - deployment. - "updated_at": "2020-02-20 00:00:00", # Optional. When the deployment - was last updated. - "workers": [ - { - "name": "str", # Optional. The name of this worker. - "source_commit_hash": "str" # Optional. The commit - hash of the repository that was used to build this worker. } ] - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_cancel_deployment_request( - app_id=app_id, - deployment_id=deployment_id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def get_logs( - self, - app_id: str, - deployment_id: str, - component_name: str, - *, - follow: Optional[bool] = None, - type: str = "UNSPECIFIED", - pod_connection_timeout: Optional[str] = None, - **kwargs: Any, - ) -> JSON: - """Retrieve Deployment Logs. - - Retrieve the logs of a past, in-progress, or active deployment. The response will include links - to either real-time logs of an in-progress or active deployment or archived logs of a past - deployment. - - :param app_id: The app ID. Required. - :type app_id: str - :param deployment_id: The deployment ID. Required. - :type deployment_id: str - :param component_name: An optional component name. If set, logs will be limited to this - component only. Required. - :type component_name: str - :keyword follow: Whether the logs should follow live updates. Default value is None. - :paramtype follow: bool - :keyword type: The type of logs to retrieve - - - * BUILD: Build-time logs - * DEPLOY: Deploy-time logs - * RUN: Live run-time logs - * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: - "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". - :paramtype type: str - :keyword pod_connection_timeout: An optional time duration to wait if the underlying component - instance is not immediately available. Default: ``3m``. Default value is None. - :paramtype pod_connection_timeout: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "historic_urls": [ - "str" # Optional. A list of URLs to archived log files. - ], - "live_url": "str" # Optional. A URL of the real-time live logs. This URL may - use either the ``https://`` or ``wss://`` protocols and will keep pushing live - logs as they become available. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_logs_request( - app_id=app_id, - deployment_id=deployment_id, - component_name=component_name, - follow=follow, - type=type, - pod_connection_timeout=pod_connection_timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def get_logs_aggregate( - self, - app_id: str, - deployment_id: str, - *, - follow: Optional[bool] = None, - type: str = "UNSPECIFIED", - pod_connection_timeout: Optional[str] = None, - **kwargs: Any, - ) -> JSON: - """Retrieve Aggregate Deployment Logs. - - Retrieve the logs of a past, in-progress, or active deployment. If a component name is - specified, the logs will be limited to only that component. The response will include links to - either real-time logs of an in-progress or active deployment or archived logs of a past - deployment. - - :param app_id: The app ID. Required. - :type app_id: str - :param deployment_id: The deployment ID. Required. - :type deployment_id: str - :keyword follow: Whether the logs should follow live updates. Default value is None. - :paramtype follow: bool - :keyword type: The type of logs to retrieve - - - * BUILD: Build-time logs - * DEPLOY: Deploy-time logs - * RUN: Live run-time logs - * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: - "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". - :paramtype type: str - :keyword pod_connection_timeout: An optional time duration to wait if the underlying component - instance is not immediately available. Default: ``3m``. Default value is None. - :paramtype pod_connection_timeout: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "historic_urls": [ - "str" # Optional. A list of URLs to archived log files. - ], - "live_url": "str" # Optional. A URL of the real-time live logs. This URL may - use either the ``https://`` or ``wss://`` protocols and will keep pushing live - logs as they become available. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_logs_aggregate_request( - app_id=app_id, - deployment_id=deployment_id, - follow=follow, - type=type, - pod_connection_timeout=pod_connection_timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def get_logs_active_deployment_aggregate( - self, - app_id: str, - *, - follow: Optional[bool] = None, - type: str = "UNSPECIFIED", - pod_connection_timeout: Optional[str] = None, - **kwargs: Any, - ) -> JSON: - """Retrieve Active Deployment Aggregate Logs. - - Retrieve the logs of the active deployment if one exists. The response will include links to - either real-time logs of an in-progress or active deployment or archived logs of a past - deployment. Note log_type=BUILD logs will return logs associated with the current active - deployment (being served). To view build logs associated with in-progress build, the query must - explicitly reference the deployment id. - - :param app_id: The app ID. Required. - :type app_id: str - :keyword follow: Whether the logs should follow live updates. Default value is None. - :paramtype follow: bool - :keyword type: The type of logs to retrieve - - - * BUILD: Build-time logs - * DEPLOY: Deploy-time logs - * RUN: Live run-time logs - * RUN_RESTARTED: Logs of crashed/restarted instances during runtime. Known values are: - "UNSPECIFIED", "BUILD", "DEPLOY", "RUN", and "RUN_RESTARTED". Default value is "UNSPECIFIED". - :paramtype type: str - :keyword pod_connection_timeout: An optional time duration to wait if the underlying component - instance is not immediately available. Default: ``3m``. Default value is None. - :paramtype pod_connection_timeout: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "historic_urls": [ - "str" # Optional. A list of URLs to archived log files. - ], - "live_url": "str" # Optional. A URL of the real-time live logs. This URL may - use either the ``https://`` or ``wss://`` protocols and will keep pushing live - logs as they become available. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_logs_active_deployment_aggregate_request( - app_id=app_id, - follow=follow, - type=type, - pod_connection_timeout=pod_connection_timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def list_tiers(self, **kwargs: Any) -> JSON: - """List App Tiers. - - List all app tiers. - - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "tiers": [ - { - "build_seconds": "str", # Optional. The amount of included - build time in seconds. - "egress_bandwidth_bytes": "str", # Optional. The amount of - included outbound bandwidth in bytes. - "name": "str", # Optional. A human-readable name of the - tier. - "slug": "str", # Optional. The slug of the tier. - "storage_bytes": "str" # Optional. The allotted disk space - in bytes. - } - ] - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_list_tiers_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def get_tier(self, slug: str, **kwargs: Any) -> JSON: - """Retrieve an App Tier. - - Retrieve information about a specific app tier. - - :param slug: The slug of the tier. Required. - :type slug: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "tier": { - "build_seconds": "str", # Optional. The amount of included build - time in seconds. - "egress_bandwidth_bytes": "str", # Optional. The amount of included - outbound bandwidth in bytes. - "name": "str", # Optional. A human-readable name of the tier. - "slug": "str", # Optional. The slug of the tier. - "storage_bytes": "str" # Optional. The allotted disk space in bytes. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_tier_request( - slug=slug, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def list_instance_sizes(self, **kwargs: Any) -> JSON: - """List Instance Sizes. - - List all instance sizes for ``service``\ , ``worker``\ , and ``job`` components. - - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "discount_percent": 0.0, # Optional. - "instance_sizes": [ - { - "bandwidth_allowance_gib": "str", # Optional. The bandwidth - allowance in GiB for the instance size. - "cpu_type": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * SHARED: Shared vCPU cores"n"n * DEDICATED: Dedicated - vCPU cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED". - "cpus": "str", # Optional. The number of allotted vCPU - cores. - "deprecation_intent": bool, # Optional. Indicates if the - instance size is intended for deprecation. - "memory_bytes": "str", # Optional. The allotted memory in - bytes. - "name": "str", # Optional. A human-readable name of the - instance size. - "scalable": bool, # Optional. Indicates if the instance size - can enable autoscaling. - "single_instance_only": bool, # Optional. Indicates if the - instance size allows more than one instance. - "slug": "str", # Optional. The slug of the instance size. - "tier_downgrade_to": "str", # Optional. The slug of the - corresponding downgradable instance size on the lower tier. - "tier_slug": "str", # Optional. The slug of the tier to - which this instance size belongs. - "tier_upgrade_to": "str", # Optional. The slug of the - corresponding upgradable instance size on the higher tier. - "usd_per_month": "str", # Optional. The cost of this - instance size in USD per month. - "usd_per_second": "str" # Optional. The cost of this - instance size in USD per second. - } - ] - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_list_instance_sizes_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def get_instance_size(self, slug: str, **kwargs: Any) -> JSON: - """Retrieve an Instance Size. - - Retrieve information about a specific instance size for ``service``\ , ``worker``\ , and - ``job`` components. - - :param slug: The slug of the instance size. Required. - :type slug: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "instance_size": { - "bandwidth_allowance_gib": "str", # Optional. The bandwidth - allowance in GiB for the instance size. - "cpu_type": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * SHARED: Shared vCPU cores"n"n * DEDICATED: Dedicated vCPU - cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED". - "cpus": "str", # Optional. The number of allotted vCPU cores. - "deprecation_intent": bool, # Optional. Indicates if the instance - size is intended for deprecation. - "memory_bytes": "str", # Optional. The allotted memory in bytes. - "name": "str", # Optional. A human-readable name of the instance - size. - "scalable": bool, # Optional. Indicates if the instance size can - enable autoscaling. - "single_instance_only": bool, # Optional. Indicates if the instance - size allows more than one instance. - "slug": "str", # Optional. The slug of the instance size. - "tier_downgrade_to": "str", # Optional. The slug of the - corresponding downgradable instance size on the lower tier. - "tier_slug": "str", # Optional. The slug of the tier to which this - instance size belongs. - "tier_upgrade_to": "str", # Optional. The slug of the corresponding - upgradable instance size on the higher tier. - "usd_per_month": "str", # Optional. The cost of this instance size - in USD per month. - "usd_per_second": "str" # Optional. The cost of this instance size - in USD per second. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. + }, + "app_id": "str" # Optional. An optional ID of an existing app. If set, the + spec will be treated as a proposed update to the specified app. The existing app + is not modified using this method. } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_get_instance_size_request( - slug=slug, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @distributed_trace - def list_regions(self, **kwargs: Any) -> JSON: - """List App Regions. - - List all regions supported by App Platform. - - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { - "regions": [ - { - "continent": "str", # Optional. The continent that this - region is in. - "data_centers": [ - "str" # Optional. Data centers that are in this - region. - ], - "default": bool, # Optional. Whether or not the region is - presented as the default. - "disabled": bool, # Optional. Whether or not the region is - open for new apps. - "flag": "str", # Optional. The flag of this region. - "label": "str", # Optional. A human-readable name of the - region. - "reason": "str", # Optional. Reason that this region is not - available. - "slug": "str" # Optional. The slug form of the region name. - } - ] - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_apps_list_regions_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) - - return cast(JSON, deserialized) - - @overload - def validate_app_spec( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Propose an App Spec. - - To propose and validate a spec for a new or existing app, send a POST request to the - ``/v2/apps/propose`` endpoint. The request returns some information about the proposed app, - including app cost and upgrade cost. If an existing app ID is specified, the app spec is - treated as a proposed update to the existing app. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "app_id": "str", # Optional. An optional ID of an existing app. If set, the - spec will be treated as a proposed update to the specified app. The existing app - is not modified using this method. + "app_cost": 0, # Optional. The monthly cost of the proposed app in USD. + "app_is_static": bool, # Optional. Indicates whether the app is a static + app. + "app_name_available": bool, # Optional. Indicates whether the app name is + available. + "app_name_suggestion": "str", # Optional. The suggested name if the proposed + app name is unavailable. + "app_tier_downgrade_cost": 0, # Optional. The monthly cost of the proposed + app in USD using the previous pricing plan tier. For example, if you propose an + app that uses the Professional tier, the ``app_tier_downgrade_cost`` field + displays the monthly cost of the app if it were to use the Basic tier. If the + proposed app already uses the lest expensive tier, the field is empty. + "existing_static_apps": "str", # Optional. The maximum number of free static + apps the account can have. We will charge you for any additional static apps. "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, @@ -74935,10 +78518,8 @@ def validate_app_spec( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of the @@ -74956,19 +78537,19 @@ def validate_app_spec( "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that + assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A + live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -74978,6 +78559,8 @@ def validate_app_spec( }, "functions": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "alerts": [ { "disabled": bool, # Optional. Is the @@ -75051,15 +78634,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -75092,6 +78674,7 @@ def validate_app_spec( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75102,18 +78685,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -75123,8 +78705,6 @@ def validate_app_spec( syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -75276,15 +78856,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -75330,12 +78909,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -75358,12 +78937,13 @@ def validate_app_spec( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75374,18 +78954,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -75411,8 +78990,6 @@ def validate_app_spec( } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -75490,15 +79067,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -75550,7 +79126,7 @@ def validate_app_spec( of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -75567,12 +79143,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -75598,6 +79174,7 @@ def validate_app_spec( service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75608,18 +79185,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -75729,15 +79305,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -75787,12 +79362,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -75806,6 +79381,7 @@ def validate_app_spec( value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75816,18 +79392,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -75901,15 +79476,317 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at + both build and run-time. Known values are: "UNSET", + "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + "type": "GENERAL", # Optional. + Default value is "GENERAL". * GENERAL: A plain-text + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". + "value": "str" # Optional. The + value. If the type is ``SECRET``"" , the value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. + } + ], + "git": { + "branch": "str", # Optional. The name of the + branch to use. + "repo_clone_url": "str" # Optional. The + clone URL of the repo. Example: + ``https://github.com/digitalocean/sample-golang.git``. + }, + "github": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "gitlab": { + "branch": "str", # Optional. The name of the + branch to use. + "deploy_on_push": bool, # Optional. Whether + to automatically deploy new commits made to the repo. + "repo": "str" # Optional. The name of the + repo in the format owner/repo. Example: + ``digitalocean/sample-golang``. + }, + "image": { + "deploy_on_push": { + "enabled": bool # Optional. Whether + to automatically deploy new images. Can only be used for + images hosted in DOCR and can only be used with an image tag, + not a specific digest. + }, + "digest": "str", # Optional. The image + digest. Cannot be specified if tag is provided. + "registry": "str", # Optional. The registry + name. Must be left empty for the ``DOCR`` registry type. + "registry_credentials": "str", # Optional. + The credentials to be able to pull the image. The value will be + encrypted on first submission. On following submissions, the + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. + "registry_type": "str", # Optional. * + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github + container registry type. Known values are: "DOCKER_HUB", "DOCR", + and "GHCR". + "repository": "str", # Optional. The + repository name. + "tag": "latest" # Optional. Default value is + "latest". The repository tag. Defaults to ``latest`` if not + provided and no digest is provided. Cannot be specified if digest + is provided. + }, + "instance_count": 1, # Optional. Default value is 1. + The amount of instances that this component should be scaled to. + Default: 1. Must not be set if autoscaling is used. + "instance_size_slug": "apps-s-1vcpu-0.5gb", # + Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to + use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values + are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", + "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", + "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", + "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", + "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". + "log_destinations": { + "name": "str", # Required. + "datadog": { + "api_key": "str", # Datadog API key. + Required. + "endpoint": "str" # Optional. + Datadog HTTP log intake endpoint. + }, + "logtail": { + "token": "str" # Optional. Logtail + token. + }, + "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. + "basic_auth": { + "password": "str", # + Password for user defined in User. Required. + "user": "str" # Username to + authenticate with. Required. + }, + "index_name": "logs" # Optional. + Default value is "logs". The index name to use for the logs. + If not set, the default index name is "logs". + }, + "papertrail": { + "endpoint": "str" # Papertrail + syslog endpoint. Required. + } + }, + "name": "str", # Optional. The name. Must be unique + across all components within the same app. + "run_command": "str", # Optional. An optional run + command to override the component's default. + "source_dir": "str", # Optional. An optional path to + the working directory to use for the build. For Dockerfile builds, + this will be used as the build context. Must be relative to the root + of the repo. + "termination": { + "grace_period_seconds": 0 # Optional. The + number of seconds to wait between sending a TERM signal to a + container and issuing a KILL which causes immediate shutdown. + (Default 120). + } + } + ] + } + } + """ + + @overload + def validate_app_spec( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Propose an App Spec. + + To propose and validate a spec for a new or existing app, send a POST request to the + ``/v2/apps/propose`` endpoint. The request returns some information about the proposed app, + including app cost and upgrade cost. If an existing app ID is specified, the app spec is + treated as a proposed update to the existing app. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "app_cost": 0, # Optional. The monthly cost of the proposed app in USD. + "app_is_static": bool, # Optional. Indicates whether the app is a static + app. + "app_name_available": bool, # Optional. Indicates whether the app name is + available. + "app_name_suggestion": "str", # Optional. The suggested name if the proposed + app name is unavailable. + "app_tier_downgrade_cost": 0, # Optional. The monthly cost of the proposed + app in USD using the previous pricing plan tier. For example, if you propose an + app that uses the Professional tier, the ``app_tier_downgrade_cost`` field + displays the monthly cost of the app if it were to use the Basic tier. If the + proposed app already uses the lest expensive tier, the field is empty. + "existing_static_apps": "str", # Optional. The maximum number of free static + apps the account can have. We will charge you for any additional static apps. + "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. + "databases": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "cluster_name": "str", # Optional. The name of the + underlying DigitalOcean DBaaS cluster. This is required for + production databases. For dev databases, if cluster_name is not set, + a new cluster will be provisioned. + "db_name": "str", # Optional. The name of the MySQL + or PostgreSQL database to configure. + "db_user": "str", # Optional. The name of the MySQL + or PostgreSQL user to configure. + "engine": "UNSET", # Optional. Default value is + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". + "production": bool, # Optional. Whether this is a + production or dev database. + "version": "str" # Optional. The version of the + database engine. + } + ], + "domains": [ + { + "domain": "str", # The hostname for the domain. + Required. + "minimum_tls_version": "str", # Optional. The + minimum version of TLS a client application can use to access + resources for the domain. Must be one of the following values + wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: + "1.2" and "1.3". + "type": "UNSPECIFIED", # Optional. Default value is + "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain + assigned to this app * PRIMARY: The primary domain for this app that + is displayed as the default in the control panel, used in bindable + environment variables, and any other places that reference an app's + live URL. Only one domain may be set as primary. * ALIAS: A + non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", + "PRIMARY", and "ALIAS". + "wildcard": bool, # Optional. Indicates whether the + domain includes all sub-domains, in addition to the given domain. + "zone": "str" # Optional. Optional. If the domain + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. + } + ], + "egress": { + "type": "AUTOASSIGN" # Optional. Default value is + "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and + "DEDICATED_IP". + }, + "functions": [ + { + "name": "str", # The name. Must be unique across all + components within the same app. Required. + "alerts": [ + { + "disabled": bool, # Optional. Is the + alert disabled?. + "operator": "UNSPECIFIED_OPERATOR", + # Optional. Default value is "UNSPECIFIED_OPERATOR". Known + values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and + "LESS_THAN". + "rule": "UNSPECIFIED_RULE", # + Optional. Default value is "UNSPECIFIED_RULE". Known values + are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", + "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", + "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", + "FUNCTIONS_ACTIVATION_COUNT", + "FUNCTIONS_AVERAGE_DURATION_MS", + "FUNCTIONS_ERROR_RATE_PER_MINUTE", + "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", + and "FUNCTIONS_GB_RATE_PER_SECOND". + "value": 0.0, # Optional. Threshold + value for alert. + "window": "UNSPECIFIED_WINDOW" # + Optional. Default value is "UNSPECIFIED_WINDOW". Known values + are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", + "THIRTY_MINUTES", and "ONE_HOUR". + } + ], + "cors": { + "allow_credentials": bool, # Optional. + Whether browsers should expose the response to the client-side + JavaScript code when the request"u2019s credentials mode is + include. This configures the ``Access-Control-Allow-Credentials`` + header. + "allow_headers": [ + "str" # Optional. The set of allowed + HTTP request headers. This configures the + ``Access-Control-Allow-Headers`` header. + ], + "allow_methods": [ + "str" # Optional. The set of allowed + HTTP methods. This configures the + ``Access-Control-Allow-Methods`` header. + ], + "allow_origins": [ + { + "exact": "str", # Optional. + Exact string match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "prefix": "str", # Optional. + Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" + , or ``regex`` must be set. + "regex": "str" # Optional. + RE2 style regex-based match. Only 1 of ``exact``"" , + ``prefix``"" , or ``regex`` must be set. For more + information about RE2 syntax, see: + https://github.com/google/re2/wiki/Syntax. + } + ], + "expose_headers": [ + "str" # Optional. The set of HTTP + response headers that browsers are allowed to access. This + configures the ``Access-Control-Expose-Headers`` header. + ], + "max_age": "str" # Optional. An optional + duration specifying how long browsers can cache the results of a + preflight request. This configures the ``Access-Control-Max-Age`` + header. + }, + "envs": [ + { + "key": "str", # The variable name. + Required. + "scope": "RUN_AND_BUILD_TIME", # + Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -75941,47 +79818,8 @@ def validate_app_spec( repo in the format owner/repo. Example: ``digitalocean/sample-golang``. }, - "image": { - "deploy_on_push": { - "enabled": bool # Optional. Whether - to automatically deploy new images. Can only be used for - images hosted in DOCR and can only be used with an image tag, - not a specific digest. - }, - "digest": "str", # Optional. The image - digest. Cannot be specified if tag is provided. - "registry": "str", # Optional. The registry - name. Must be left empty for the ``DOCR`` registry type. - "registry_credentials": "str", # Optional. - The credentials to be able to pull the image. The value will be - encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. - "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github - container registry type. Known values are: "DOCKER_HUB", "DOCR", - and "GHCR". - "repository": "str", # Optional. The - repository name. - "tag": "latest" # Optional. Default value is - "latest". The repository tag. Defaults to ``latest`` if not - provided and no digest is provided. Cannot be specified if digest - is provided. - }, - "instance_count": 1, # Optional. Default value is 1. - The amount of instances that this component should be scaled to. - Default: 1. Must not be set if autoscaling is used. - "instance_size_slug": "apps-s-1vcpu-0.5gb", # - Optional. Default value is "apps-s-1vcpu-0.5gb". The instance size to - use for this component. Default: ``apps-s-1vcpu-0.5gb``. Known values - are: "apps-s-1vcpu-0.5gb", "apps-s-1vcpu-1gb-fixed", - "apps-s-1vcpu-1gb", "apps-s-1vcpu-2gb", "apps-s-2vcpu-4gb", - "apps-d-1vcpu-0.5gb", "apps-d-1vcpu-1gb", "apps-d-1vcpu-2gb", - "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", - "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -75992,253 +79830,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { - "basic_auth": { - "password": "str", # - Password for user defined in User. Required. - "user": "str" # Username to - authenticate with. Required. - }, "endpoint": "str", # OpenSearch API Endpoint. Only HTTPS is supported. Format: :code:``::code:``. Default port is 9300. Required. - "index_name": "logs" # Optional. - Default value is "logs". The index name to use for the logs. - If not set, the default index name is "logs". - }, - "papertrail": { - "endpoint": "str" # Papertrail - syslog endpoint. Required. - } - }, - "name": "str", # Optional. The name. Must be unique - across all components within the same app. - "run_command": "str", # Optional. An optional run - command to override the component's default. - "source_dir": "str", # Optional. An optional path to - the working directory to use for the build. For Dockerfile builds, - this will be used as the build context. Must be relative to the root - of the repo. - "termination": { - "grace_period_seconds": 0 # Optional. The - number of seconds to wait between sending a TERM signal to a - container and issuing a KILL which causes immediate shutdown. - (Default 120). - } - } - ] - } - } - - # response body for status code(s): 200 - response == { - "app_cost": 0, # Optional. The monthly cost of the proposed app in USD. - "app_is_static": bool, # Optional. Indicates whether the app is a static - app. - "app_name_available": bool, # Optional. Indicates whether the app name is - available. - "app_name_suggestion": "str", # Optional. The suggested name if the proposed - app name is unavailable. - "app_tier_downgrade_cost": 0, # Optional. The monthly cost of the proposed - app in USD using the previous pricing plan tier. For example, if you propose an - app that uses the Professional tier, the ``app_tier_downgrade_cost`` field - displays the monthly cost of the app if it were to use the Basic tier. If the - proposed app already uses the lest expensive tier, the field is empty. - "existing_static_apps": "str", # Optional. The maximum number of free static - apps the account can have. We will charge you for any additional static apps. - "spec": { - "databases": [ - { - "cluster_name": "str", # Optional. The name of the - underlying DigitalOcean DBaaS cluster. This is required for - production databases. For dev databases, if cluster_name is not set, - a new cluster will be provisioned. - "db_name": "str", # Optional. The name of the MySQL - or PostgreSQL database to configure. - "db_user": "str", # Optional. The name of the MySQL - or PostgreSQL user to configure. - "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. - "production": bool, # Optional. Whether this is a - production or dev database. - "version": "str" # Optional. The version of the - database engine. - } - ], - "domains": [ - { - "domain": "str", # The hostname for the domain. - Required. - "minimum_tls_version": "str", # Optional. The - minimum version of TLS a client application can use to access - resources for the domain. Must be one of the following values - wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are: - "1.2" and "1.3". - "type": "UNSPECIFIED", # Optional. Default value is - "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that - is displayed as the default in the control panel, used in bindable - environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A - non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", - "PRIMARY", and "ALIAS". - "wildcard": bool, # Optional. Indicates whether the - domain includes all sub-domains, in addition to the given domain. - "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. - } - ], - "egress": { - "type": "AUTOASSIGN" # Optional. Default value is - "AUTOASSIGN". The app egress type. Known values are: "AUTOASSIGN" and - "DEDICATED_IP". - }, - "functions": [ - { - "alerts": [ - { - "disabled": bool, # Optional. Is the - alert disabled?. - "operator": "UNSPECIFIED_OPERATOR", - # Optional. Default value is "UNSPECIFIED_OPERATOR". Known - values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and - "LESS_THAN". - "rule": "UNSPECIFIED_RULE", # - Optional. Default value is "UNSPECIFIED_RULE". Known values - are: "UNSPECIFIED_RULE", "CPU_UTILIZATION", - "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED", - "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE", - "FUNCTIONS_ACTIVATION_COUNT", - "FUNCTIONS_AVERAGE_DURATION_MS", - "FUNCTIONS_ERROR_RATE_PER_MINUTE", - "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", - and "FUNCTIONS_GB_RATE_PER_SECOND". - "value": 0.0, # Optional. Threshold - value for alert. - "window": "UNSPECIFIED_WINDOW" # - Optional. Default value is "UNSPECIFIED_WINDOW". Known values - are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES", - "THIRTY_MINUTES", and "ONE_HOUR". - } - ], - "cors": { - "allow_credentials": bool, # Optional. - Whether browsers should expose the response to the client-side - JavaScript code when the request"u2019s credentials mode is - include. This configures the ``Access-Control-Allow-Credentials`` - header. - "allow_headers": [ - "str" # Optional. The set of allowed - HTTP request headers. This configures the - ``Access-Control-Allow-Headers`` header. - ], - "allow_methods": [ - "str" # Optional. The set of allowed - HTTP methods. This configures the - ``Access-Control-Allow-Methods`` header. - ], - "allow_origins": [ - { - "exact": "str", # Optional. - Exact string match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "prefix": "str", # Optional. - Prefix-based match. Only 1 of ``exact``"" , ``prefix``"" - , or ``regex`` must be set. - "regex": "str" # Optional. - RE2 style regex-based match. Only 1 of ``exact``"" , - ``prefix``"" , or ``regex`` must be set. For more - information about RE2 syntax, see: - https://github.com/google/re2/wiki/Syntax. - } - ], - "expose_headers": [ - "str" # Optional. The set of HTTP - response headers that browsers are allowed to access. This - configures the ``Access-Control-Expose-Headers`` header. - ], - "max_age": "str" # Optional. An optional - duration specifying how long browsers can cache the results of a - preflight request. This configures the ``Access-Control-Max-Age`` - header. - }, - "envs": [ - { - "key": "str", # The variable name. - Required. - "scope": "RUN_AND_BUILD_TIME", # - Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at - both build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". - "type": "GENERAL", # Optional. - Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". - "value": "str" # Optional. The - value. If the type is ``SECRET``"" , the value will be - encrypted on first submission. On following submissions, the - encrypted value should be used. - } - ], - "git": { - "branch": "str", # Optional. The name of the - branch to use. - "repo_clone_url": "str" # Optional. The - clone URL of the repo. Example: - ``https://github.com/digitalocean/sample-golang.git``. - }, - "github": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "gitlab": { - "branch": "str", # Optional. The name of the - branch to use. - "deploy_on_push": bool, # Optional. Whether - to automatically deploy new commits made to the repo. - "repo": "str" # Optional. The name of the - repo in the format owner/repo. Example: - ``digitalocean/sample-golang``. - }, - "log_destinations": { - "datadog": { - "api_key": "str", # Datadog API key. - Required. - "endpoint": "str" # Optional. - Datadog HTTP log intake endpoint. - }, - "logtail": { - "token": "str" # Optional. Logtail - token. - }, - "name": "str", # Required. - "open_search": { "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -76248,8 +79850,6 @@ def validate_app_spec( syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -76401,15 +80001,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -76455,12 +80054,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -76483,12 +80082,13 @@ def validate_app_spec( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -76499,18 +80099,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -76536,8 +80135,6 @@ def validate_app_spec( } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -76615,15 +80212,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -76675,7 +80271,7 @@ def validate_app_spec( of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -76692,12 +80288,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -76723,6 +80319,7 @@ def validate_app_spec( service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -76733,18 +80330,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -76854,15 +80450,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -76912,12 +80507,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -76931,6 +80526,7 @@ def validate_app_spec( value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -76941,18 +80537,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -77026,15 +80621,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -77080,12 +80674,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -77107,6 +80701,7 @@ def validate_app_spec( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -77117,18 +80712,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -77158,10 +80752,9 @@ def validate_app_spec( } """ - @overload - def validate_app_spec( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: + @distributed_trace + def validate_app_spec(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Propose an App Spec. To propose and validate a spec for a new or existing app, send a POST request to the @@ -77169,11 +80762,8 @@ def validate_app_spec( including app cost and upgrade cost. If an existing app ID is specified, the app spec is treated as a proposed update to the existing app. - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -77181,25 +80771,15 @@ def validate_app_spec( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "app_cost": 0, # Optional. The monthly cost of the proposed app in USD. - "app_is_static": bool, # Optional. Indicates whether the app is a static - app. - "app_name_available": bool, # Optional. Indicates whether the app name is - available. - "app_name_suggestion": "str", # Optional. The suggested name if the proposed - app name is unavailable. - "app_tier_downgrade_cost": 0, # Optional. The monthly cost of the proposed - app in USD using the previous pricing plan tier. For example, if you propose an - app that uses the Professional tier, the ``app_tier_downgrade_cost`` field - displays the monthly cost of the app if it were to use the Basic tier. If the - proposed app already uses the lest expensive tier, the field is empty. - "existing_static_apps": "str", # Optional. The maximum number of free static - apps the account can have. We will charge you for any additional static apps. + # JSON input template you can fill out and use as your body input. + body = { "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, @@ -77209,10 +80789,8 @@ def validate_app_spec( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of the @@ -77230,19 +80808,19 @@ def validate_app_spec( "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that + assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A + live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -77252,6 +80830,8 @@ def validate_app_spec( }, "functions": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "alerts": [ { "disabled": bool, # Optional. Is the @@ -77325,15 +80905,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -77366,6 +80945,7 @@ def validate_app_spec( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -77376,18 +80956,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -77397,8 +80976,6 @@ def validate_app_spec( syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -77550,15 +81127,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -77604,12 +81180,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -77632,12 +81208,13 @@ def validate_app_spec( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -77648,18 +81225,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -77685,8 +81261,6 @@ def validate_app_spec( } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -77764,15 +81338,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -77824,7 +81397,7 @@ def validate_app_spec( of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -77841,12 +81414,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -77872,6 +81445,7 @@ def validate_app_spec( service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -77882,18 +81456,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -78003,15 +81576,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -78061,12 +81633,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -78080,6 +81652,7 @@ def validate_app_spec( value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78090,18 +81663,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -78175,15 +81747,14 @@ def validate_app_spec( Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -78229,12 +81800,12 @@ def validate_app_spec( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -78256,6 +81827,7 @@ def validate_app_spec( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78266,18 +81838,17 @@ def validate_app_spec( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -78303,30 +81874,11 @@ def validate_app_spec( } } ] - } + }, + "app_id": "str" # Optional. An optional ID of an existing app. If set, the + spec will be treated as a proposed update to the specified app. The existing app + is not modified using this method. } - """ - - @distributed_trace - def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Propose an App Spec. - - To propose and validate a spec for a new or existing app, send a POST request to the - ``/v2/apps/propose`` endpoint. The request returns some information about the proposed app, - including app cost and upgrade cost. If an existing app ID is specified, the app spec is - treated as a proposed update to the existing app. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { @@ -78345,8 +81897,12 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "existing_static_apps": "str", # Optional. The maximum number of free static apps the account can have. We will charge you for any additional static apps. "spec": { + "name": "str", # The name of the app. Must be unique across all apps + in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, @@ -78356,10 +81912,8 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value is - "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known - values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique across all - components within the same app. Required. + "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known values + are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of the @@ -78377,19 +81931,19 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain - assigned to this app"n* PRIMARY: The primary domain for this app that + assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's - live URL. Only one domain may be set as primary."n* ALIAS: A + live URL. Only one domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the domain - uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of the"ndomain - on your account."n"nFor example, If the domain you are adding is - ``app.domain.com``"" , the zone"ncould be ``domain.com``. + uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the domain + on your account. For example, If the domain you are adding is + ``app.domain.com``"" , the zone could be ``domain.com``. } ], "egress": { @@ -78399,6 +81953,8 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be unique across all + components within the same app. Required. "alerts": [ { "disabled": bool, # Optional. Is the @@ -78472,15 +82028,14 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -78513,6 +82068,7 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78523,18 +82079,17 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -78544,8 +82099,6 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique across all - components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -78697,15 +82250,14 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -78751,12 +82303,12 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -78779,12 +82331,13 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to - POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an - app deployment."n* POST_DEPLOY: Indicates a job that runs after an - app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a + POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job that runs before an + app deployment. * POST_DEPLOY: Indicates a job that runs after an app + deployment. * FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -78795,18 +82348,17 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -78832,8 +82384,6 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique across all apps - in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd". @@ -78911,15 +82461,14 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -78971,7 +82520,7 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: of seconds after which the check times out. }, "http_port": 0, # Optional. The internal port on - which this service's run command will listen. Default: 8080"nIf there + which this service's run command will listen. Default: 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -78988,12 +82537,12 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -79019,6 +82568,7 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -79029,18 +82579,17 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -79150,15 +82699,14 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -79208,12 +82756,12 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -79227,6 +82775,7 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -79237,18 +82786,17 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -79322,15 +82870,14 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Required. "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: - Made available only at run-time"n* BUILD_TIME: Made available - only at build-time"n* RUN_AND_BUILD_TIME: Made available at + Made available only at run-time * BUILD_TIME: Made available + only at build-time * RUN_AND_BUILD_TIME: Made available at both build and run-time. Known values are: "UNSET", "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A plain-text - environment variable"n* SECRET: A secret encrypted - environment variable. Known values are: "GENERAL" and - "SECRET". + environment variable * SECRET: A secret encrypted environment + variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. The value. If the type is ``SECRET``"" , the value will be encrypted on first submission. On following submissions, the @@ -79376,12 +82923,12 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the - encrypted value should be used."n"n"n* "$username:$access_token" - for registries of type ``DOCKER_HUB``."n* - "$username:$access_token" for registries of type ``GHCR``. + encrypted value should be used. * "$username:$access_token" for + registries of type ``DOCKER_HUB``. * "$username:$access_token" + for registries of type ``GHCR``. "registry_type": "str", # Optional. * - DOCKER_HUB: The DockerHub container registry type."n* DOCR: The - DigitalOcean container registry type."n* GHCR: The Github + DOCKER_HUB: The DockerHub container registry type. * DOCR: The + DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -79403,6 +82950,7 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -79413,18 +82961,17 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # OpenSearch API + Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # OpenSearch API - Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is "logs". @@ -79453,10 +83000,14 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -79465,38 +83016,41 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_validate_app_spec_request( + _request = build_apps_validate_app_spec_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -79516,12 +83070,13 @@ def validate_app_spec(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List all app alerts. List alerts associated to the app and any components. This includes configuration information @@ -79614,10 +83169,14 @@ def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -79626,25 +83185,28 @@ def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_list_alerts_request( + _request = build_apps_list_alerts_request( app_id=app_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -79681,9 +83243,9 @@ def list_alerts(self, app_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def assign_alert_destinations( @@ -79695,6 +83257,7 @@ def assign_alert_destinations( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update destinations for alerts. Updates the emails and slack webhook destinations for app alerts. Emails must be associated to @@ -79807,11 +83370,12 @@ def assign_alert_destinations( self, app_id: str, alert_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update destinations for alerts. Updates the emails and slack webhook destinations for app alerts. Emails must be associated to @@ -79822,7 +83386,7 @@ def assign_alert_destinations( :param alert_id: The alert ID. Required. :type alert_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -79907,8 +83471,9 @@ def assign_alert_destinations( @distributed_trace def assign_alert_destinations( - self, app_id: str, alert_id: str, body: Union[JSON, IO], **kwargs: Any + self, app_id: str, alert_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update destinations for alerts. Updates the emails and slack webhook destinations for app alerts. Emails must be associated to @@ -79918,11 +83483,8 @@ def assign_alert_destinations( :type app_id: str :param alert_id: The alert ID. Required. :type alert_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -79930,6 +83492,20 @@ def assign_alert_destinations( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "emails": [ + "" # Optional. Default value is "". + ], + "slack_webhooks": [ + { + "channel": "str", # Optional. Name of the Slack Webhook + Channel. + "url": "str" # Optional. URL of the Slack webhook. + } + ] + } + # response body for status code(s): 200 response == { "alert": { @@ -80001,10 +83577,14 @@ def assign_alert_destinations( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -80013,20 +83593,20 @@ def assign_alert_destinations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_assign_alert_destinations_request( + _request = build_apps_assign_alert_destinations_request( app_id=app_id, alert_id=alert_id, content_type=content_type, @@ -80035,18 +83615,21 @@ def assign_alert_destinations( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -80083,9 +83666,9 @@ def assign_alert_destinations( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_rollback( @@ -80096,6 +83679,7 @@ def create_rollback( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Rollback App. Rollback an app to a previous deployment. A new deployment will be created to perform the @@ -80180,9 +83764,8 @@ def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -80211,9 +83794,8 @@ def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -80243,8 +83825,12 @@ def create_rollback( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -80254,10 +83840,8 @@ def create_rollback( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -80275,21 +83859,21 @@ def create_rollback( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -80300,6 +83884,8 @@ def create_rollback( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -80377,13 +83963,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -80418,6 +84004,7 @@ def create_rollback( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -80428,18 +84015,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -80450,8 +84036,6 @@ def create_rollback( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -80612,13 +84196,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -80667,13 +84251,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -80696,13 +84280,14 @@ def create_rollback( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -80713,18 +84298,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -80751,8 +84335,6 @@ def create_rollback( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -80834,13 +84416,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -80898,7 +84480,7 @@ def create_rollback( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -80916,13 +84498,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -80948,6 +84530,7 @@ def create_rollback( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -80958,18 +84541,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -81084,13 +84666,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -81144,13 +84726,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -81164,6 +84746,7 @@ def create_rollback( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -81174,18 +84757,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -81262,13 +84844,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -81317,13 +84899,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -81345,6 +84927,7 @@ def create_rollback( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -81355,18 +84938,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -81432,11 +85014,12 @@ def create_rollback( def create_rollback( self, app_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Rollback App. Rollback an app to a previous deployment. A new deployment will be created to perform the @@ -81453,7 +85036,7 @@ def create_rollback( :param app_id: The app ID. Required. :type app_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -81510,9 +85093,8 @@ def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -81541,9 +85123,8 @@ def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -81573,8 +85154,12 @@ def create_rollback( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -81584,10 +85169,8 @@ def create_rollback( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -81605,21 +85188,21 @@ def create_rollback( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -81630,6 +85213,8 @@ def create_rollback( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -81707,13 +85292,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -81748,6 +85333,7 @@ def create_rollback( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -81758,18 +85344,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -81780,8 +85365,6 @@ def create_rollback( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -81942,13 +85525,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -81997,13 +85580,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -82026,13 +85609,14 @@ def create_rollback( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -82043,18 +85627,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -82081,8 +85664,6 @@ def create_rollback( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -82164,13 +85745,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -82228,7 +85809,7 @@ def create_rollback( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -82246,13 +85827,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -82278,6 +85859,7 @@ def create_rollback( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -82288,18 +85870,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -82414,13 +85995,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -82474,13 +86055,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -82494,6 +86075,7 @@ def create_rollback( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -82504,18 +86086,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -82592,13 +86173,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -82647,13 +86228,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -82675,6 +86256,7 @@ def create_rollback( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -82685,18 +86267,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -82760,8 +86341,9 @@ def create_rollback( @distributed_trace def create_rollback( - self, app_id: str, body: Union[JSON, IO], **kwargs: Any + self, app_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Rollback App. Rollback an app to a previous deployment. A new deployment will be created to perform the @@ -82777,11 +86359,8 @@ def create_rollback( :param app_id: The app ID. Required. :type app_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -82789,6 +86368,17 @@ def create_rollback( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "deployment_id": "str", # Optional. The ID of the deployment to rollback to. + "skip_pin": bool # Optional. Whether to skip pinning the rollback + deployment. If false, the rollback deployment will be pinned and any new + deployments including Auto Deploy on Push hooks will be disabled until the + rollback is either manually committed or reverted via the CommitAppRollback or + RevertAppRollback endpoints respectively. If true, the rollback will be + immediately committed and the app will remain unpinned. + } + # response body for status code(s): 200 response == { "deployment": { @@ -82835,9 +86425,8 @@ def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -82866,9 +86455,8 @@ def create_rollback( Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -82898,8 +86486,12 @@ def create_rollback( } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -82909,10 +86501,8 @@ def create_rollback( "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -82930,21 +86520,21 @@ def create_rollback( are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -82955,6 +86545,8 @@ def create_rollback( }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -83032,13 +86624,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -83073,6 +86665,7 @@ def create_rollback( ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -83083,18 +86676,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -83105,8 +86697,6 @@ def create_rollback( Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -83267,13 +86857,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -83322,13 +86912,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -83351,13 +86941,14 @@ def create_rollback( "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -83368,18 +86959,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -83406,8 +86996,6 @@ def create_rollback( } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -83489,13 +87077,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -83553,7 +87141,7 @@ def create_rollback( }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -83571,13 +87159,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -83603,6 +87191,7 @@ def create_rollback( this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -83613,18 +87202,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -83739,13 +87327,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -83799,13 +87387,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -83819,6 +87407,7 @@ def create_rollback( Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -83829,18 +87418,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -83917,13 +87505,13 @@ def create_rollback( "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -83972,13 +87560,13 @@ def create_rollback( "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -84000,6 +87588,7 @@ def create_rollback( "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -84010,18 +87599,17 @@ def create_rollback( "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -84082,10 +87670,14 @@ def create_rollback( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84094,20 +87686,20 @@ def create_rollback( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_create_rollback_request( + _request = build_apps_create_rollback_request( app_id=app_id, content_type=content_type, json=_json, @@ -84115,18 +87707,21 @@ def create_rollback( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -84163,9 +87758,9 @@ def create_rollback( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def validate_rollback( @@ -84176,6 +87771,7 @@ def validate_rollback( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Validate App Rollback. Check whether an app can be rolled back to a specific deployment. This endpoint can also be @@ -84215,23 +87811,23 @@ def validate_rollback( response == { "error": { "code": "str", # Optional. A code identifier that represents the - failing condition."n"nFailing conditions:"n"n"n* ``incompatible_phase`` - - indicates that the deployment's phase is not suitable for rollback."n* + failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * ``incompatible_result`` - indicates that the deployment's result is not - suitable for rollback."n* ``exceeded_revision_limit`` - indicates that the - app has exceeded the rollback revision limits for its tier."n* ``app_pinned`` - - indicates that there is already a rollback in progress and the app is - pinned."n* ``database_config_conflict`` - indicates that the deployment's - database config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that the - deployment contains at least one component with an image source that is - missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the app + has exceeded the rollback revision limits for its tier. * ``app_pinned`` - + indicates that there is already a rollback in progress and the app is pinned. + * ``database_config_conflict`` - indicates that the deployment's database + config is different than the current config. * ``region_conflict`` - + indicates that the deployment's region differs from the current app region. + Warning conditions: * ``static_site_requires_rebuild`` - indicates that the + deployment contains at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains at + least one component with an image source that is missing a digest. Known + values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. ], @@ -84243,24 +87839,24 @@ def validate_rollback( "warnings": [ { "code": "str", # Optional. A code identifier that represents - the failing condition."n"nFailing conditions:"n"n"n* - ``incompatible_phase`` - indicates that the deployment's phase is not - suitable for rollback."n* ``incompatible_result`` - indicates that the - deployment's result is not suitable for rollback."n* - ``exceeded_revision_limit`` - indicates that the app has exceeded the - rollback revision limits for its tier."n* ``app_pinned`` - indicates that - there is already a rollback in progress and the app is pinned."n* - ``database_config_conflict`` - indicates that the deployment's database - config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that - the deployment contains at least one component with an image source that - is missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + the failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * + ``incompatible_result`` - indicates that the deployment's result is not + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the + app has exceeded the rollback revision limits for its tier. * + ``app_pinned`` - indicates that there is already a rollback in progress + and the app is pinned. * ``database_config_conflict`` - indicates that + the deployment's database config is different than the current config. * + ``region_conflict`` - indicates that the deployment's region differs from + the current app region. Warning conditions: * + ``static_site_requires_rebuild`` - indicates that the deployment contains + at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains + at least one component with an image source that is missing a digest. + Known values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. Contains a list of warnings that may cause the rollback to run under unideal circumstances. @@ -84287,11 +87883,12 @@ def validate_rollback( def validate_rollback( self, app_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Validate App Rollback. Check whether an app can be rolled back to a specific deployment. This endpoint can also be @@ -84305,7 +87902,7 @@ def validate_rollback( :param app_id: The app ID. Required. :type app_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -84320,23 +87917,23 @@ def validate_rollback( response == { "error": { "code": "str", # Optional. A code identifier that represents the - failing condition."n"nFailing conditions:"n"n"n* ``incompatible_phase`` - - indicates that the deployment's phase is not suitable for rollback."n* + failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * ``incompatible_result`` - indicates that the deployment's result is not - suitable for rollback."n* ``exceeded_revision_limit`` - indicates that the - app has exceeded the rollback revision limits for its tier."n* ``app_pinned`` - - indicates that there is already a rollback in progress and the app is - pinned."n* ``database_config_conflict`` - indicates that the deployment's - database config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that the - deployment contains at least one component with an image source that is - missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the app + has exceeded the rollback revision limits for its tier. * ``app_pinned`` - + indicates that there is already a rollback in progress and the app is pinned. + * ``database_config_conflict`` - indicates that the deployment's database + config is different than the current config. * ``region_conflict`` - + indicates that the deployment's region differs from the current app region. + Warning conditions: * ``static_site_requires_rebuild`` - indicates that the + deployment contains at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains at + least one component with an image source that is missing a digest. Known + values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. ], @@ -84348,24 +87945,24 @@ def validate_rollback( "warnings": [ { "code": "str", # Optional. A code identifier that represents - the failing condition."n"nFailing conditions:"n"n"n* - ``incompatible_phase`` - indicates that the deployment's phase is not - suitable for rollback."n* ``incompatible_result`` - indicates that the - deployment's result is not suitable for rollback."n* - ``exceeded_revision_limit`` - indicates that the app has exceeded the - rollback revision limits for its tier."n* ``app_pinned`` - indicates that - there is already a rollback in progress and the app is pinned."n* - ``database_config_conflict`` - indicates that the deployment's database - config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that - the deployment contains at least one component with an image source that - is missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + the failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * + ``incompatible_result`` - indicates that the deployment's result is not + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the + app has exceeded the rollback revision limits for its tier. * + ``app_pinned`` - indicates that there is already a rollback in progress + and the app is pinned. * ``database_config_conflict`` - indicates that + the deployment's database config is different than the current config. * + ``region_conflict`` - indicates that the deployment's region differs from + the current app region. Warning conditions: * + ``static_site_requires_rebuild`` - indicates that the deployment contains + at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains + at least one component with an image source that is missing a digest. + Known values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. Contains a list of warnings that may cause the rollback to run under unideal circumstances. @@ -84390,8 +87987,9 @@ def validate_rollback( @distributed_trace def validate_rollback( - self, app_id: str, body: Union[JSON, IO], **kwargs: Any + self, app_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Validate App Rollback. Check whether an app can be rolled back to a specific deployment. This endpoint can also be @@ -84404,11 +88002,8 @@ def validate_rollback( :param app_id: The app ID. Required. :type app_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -84416,27 +88011,38 @@ def validate_rollback( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "deployment_id": "str", # Optional. The ID of the deployment to rollback to. + "skip_pin": bool # Optional. Whether to skip pinning the rollback + deployment. If false, the rollback deployment will be pinned and any new + deployments including Auto Deploy on Push hooks will be disabled until the + rollback is either manually committed or reverted via the CommitAppRollback or + RevertAppRollback endpoints respectively. If true, the rollback will be + immediately committed and the app will remain unpinned. + } + # response body for status code(s): 200 response == { "error": { "code": "str", # Optional. A code identifier that represents the - failing condition."n"nFailing conditions:"n"n"n* ``incompatible_phase`` - - indicates that the deployment's phase is not suitable for rollback."n* + failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * ``incompatible_result`` - indicates that the deployment's result is not - suitable for rollback."n* ``exceeded_revision_limit`` - indicates that the - app has exceeded the rollback revision limits for its tier."n* ``app_pinned`` - - indicates that there is already a rollback in progress and the app is - pinned."n* ``database_config_conflict`` - indicates that the deployment's - database config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that the - deployment contains at least one component with an image source that is - missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the app + has exceeded the rollback revision limits for its tier. * ``app_pinned`` - + indicates that there is already a rollback in progress and the app is pinned. + * ``database_config_conflict`` - indicates that the deployment's database + config is different than the current config. * ``region_conflict`` - + indicates that the deployment's region differs from the current app region. + Warning conditions: * ``static_site_requires_rebuild`` - indicates that the + deployment contains at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains at + least one component with an image source that is missing a digest. Known + values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. ], @@ -84448,24 +88054,24 @@ def validate_rollback( "warnings": [ { "code": "str", # Optional. A code identifier that represents - the failing condition."n"nFailing conditions:"n"n"n* - ``incompatible_phase`` - indicates that the deployment's phase is not - suitable for rollback."n* ``incompatible_result`` - indicates that the - deployment's result is not suitable for rollback."n* - ``exceeded_revision_limit`` - indicates that the app has exceeded the - rollback revision limits for its tier."n* ``app_pinned`` - indicates that - there is already a rollback in progress and the app is pinned."n* - ``database_config_conflict`` - indicates that the deployment's database - config is different than the current config."n* ``region_conflict`` - - indicates that the deployment's region differs from the current app - region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` - - indicates that the deployment contains at least one static site that will - require a rebuild."n* ``image_source_missing_digest`` - indicates that - the deployment contains at least one component with an image source that - is missing a digest. Known values are: "incompatible_phase", - "incompatible_result", "exceeded_revision_limit", "app_pinned", - "database_config_conflict", "region_conflict", - "static_site_requires_rebuild", and "image_source_missing_digest". + the failing condition. Failing conditions: * ``incompatible_phase`` - + indicates that the deployment's phase is not suitable for rollback. * + ``incompatible_result`` - indicates that the deployment's result is not + suitable for rollback. * ``exceeded_revision_limit`` - indicates that the + app has exceeded the rollback revision limits for its tier. * + ``app_pinned`` - indicates that there is already a rollback in progress + and the app is pinned. * ``database_config_conflict`` - indicates that + the deployment's database config is different than the current config. * + ``region_conflict`` - indicates that the deployment's region differs from + the current app region. Warning conditions: * + ``static_site_requires_rebuild`` - indicates that the deployment contains + at least one static site that will require a rebuild. * + ``image_source_missing_digest`` - indicates that the deployment contains + at least one component with an image source that is missing a digest. + Known values are: "incompatible_phase", "incompatible_result", + "exceeded_revision_limit", "app_pinned", "database_config_conflict", + "region_conflict", "static_site_requires_rebuild", and + "image_source_missing_digest". "components": [ "str" # Optional. Contains a list of warnings that may cause the rollback to run under unideal circumstances. @@ -84487,10 +88093,14 @@ def validate_rollback( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84499,20 +88109,20 @@ def validate_rollback( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_validate_rollback_request( + _request = build_apps_validate_rollback_request( app_id=app_id, content_type=content_type, json=_json, @@ -84520,18 +88130,21 @@ def validate_rollback( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -84568,12 +88181,13 @@ def validate_rollback( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def commit_rollback(self, app_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Commit App Rollback. Commit an app rollback. This action permanently applies the rollback and unpins the app to @@ -84600,10 +88214,14 @@ def commit_rollback(self, app_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -84612,25 +88230,28 @@ def commit_rollback(self, app_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_apps_commit_rollback_request( + _request = build_apps_commit_rollback_request( app_id=app_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -84663,12 +88284,13 @@ def commit_rollback(self, app_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Revert App Rollback. Revert an app rollback. This action reverts the active rollback by creating a new deployment @@ -84730,9 +88352,8 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -84761,9 +88382,8 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: Optional. The end time of this step. "message_base": "str", # Optional. The base of a human-readable description of the step intended to be - combined with the component name for presentation. For - example:"n"n``message_base`` = "Building - service""n``component_name`` = "api". + combined with the component name for presentation. For example: + ``message_base`` = "Building service" ``component_name`` = "api". "name": "str", # Optional. The name of this step. "reason": { @@ -84793,8 +88413,12 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: } ], "spec": { + "name": "str", # The name of the app. Must be unique across + all apps in the same account. Required. "databases": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "cluster_name": "str", # Optional. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is @@ -84804,10 +88428,8 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "db_user": "str", # Optional. The name of the MySQL or PostgreSQL user to configure. "engine": "UNSET", # Optional. Default value - is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. - Known values are: "UNSET", "MYSQL", "PG", and "REDIS". - "name": "str", # The name. Must be unique - across all components within the same app. Required. + is "UNSET". * MYSQL: MySQL * PG: PostgreSQL * REDIS: Redis. Known + values are: "UNSET", "MYSQL", "PG", and "REDIS". "production": bool, # Optional. Whether this is a production or dev database. "version": "str" # Optional. The version of @@ -84825,21 +88447,21 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: are: "1.2" and "1.3". "type": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * DEFAULT: The default - ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY: + ``.ondigitalocean.app`` domain assigned to this app * PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one - domain may be set as primary."n* ALIAS: A non-primary domain. + domain may be set as primary. * ALIAS: A non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS". "wildcard": bool, # Optional. Indicates whether the domain includes all sub-domains, in addition to the given domain. "zone": "str" # Optional. Optional. If the - domain uses DigitalOcean DNS and you would like App"nPlatform to - automatically manage it for you, set this to the name of - the"ndomain on your account."n"nFor example, If the domain you - are adding is ``app.domain.com``"" , the zone"ncould be + domain uses DigitalOcean DNS and you would like App Platform to + automatically manage it for you, set this to the name of the + domain on your account. For example, If the domain you are + adding is ``app.domain.com``"" , the zone could be ``domain.com``. } ], @@ -84850,6 +88472,8 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: }, "functions": [ { + "name": "str", # The name. Must be unique + across all components within the same app. Required. "alerts": [ { "disabled": bool, # @@ -84927,13 +88551,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -84968,6 +88592,7 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: ``digitalocean/sample-golang``. }, "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -84978,18 +88603,17 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -85000,8 +88624,6 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: Papertrail syslog endpoint. Required. } }, - "name": "str", # The name. Must be unique - across all components within the same app. Required. "routes": [ { "path": "str", # Optional. @@ -85162,13 +88784,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -85217,13 +88839,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -85246,13 +88868,14 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "kind": "UNSPECIFIED", # Optional. Default value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will - auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job - that runs before an app deployment."n* POST_DEPLOY: Indicates a - job that runs after an app deployment."n* FAILED_DEPLOY: - Indicates a job that runs after a component fails to deploy. - Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and + auto-complete to POST_DEPLOY kind. * PRE_DEPLOY: Indicates a job + that runs before an app deployment. * POST_DEPLOY: Indicates a + job that runs after an app deployment. * FAILED_DEPLOY: Indicates + a job that runs after a component fails to deploy. Known values + are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -85263,18 +88886,17 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -85301,8 +88923,6 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: } } ], - "name": "str", # The name of the app. Must be unique across - all apps in the same account. Required. "region": "str", # Optional. The slug form of the geographical origin of the app. Default: ``nearest available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and @@ -85384,13 +89004,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -85448,7 +89068,7 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: }, "http_port": 0, # Optional. The internal port on which this service's run command will listen. Default: - 8080"nIf there is not an environment variable with the name + 8080 If there is not an environment variable with the name ``PORT``"" , one will be automatically added with its value set to the value of this field. "image": { @@ -85466,13 +89086,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -85498,6 +89118,7 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: this service will listen for internal traffic. ], "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -85508,18 +89129,17 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -85634,13 +89254,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -85694,13 +89314,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -85714,6 +89334,7 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: Default value is "index.html". The name of the index document to use when serving this static site. Default: index.html. "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -85724,18 +89345,17 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -85812,13 +89432,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "scope": "RUN_AND_BUILD_TIME", # Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at - run-time"n* BUILD_TIME: Made available only at - build-time"n* RUN_AND_BUILD_TIME: Made available at both - build and run-time. Known values are: "UNSET", - "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME". + run-time * BUILD_TIME: Made available only at build-time + * RUN_AND_BUILD_TIME: Made available at both build and + run-time. Known values are: "UNSET", "RUN_TIME", + "BUILD_TIME", and "RUN_AND_BUILD_TIME". "type": "GENERAL", # Optional. Default value is "GENERAL". * GENERAL: A - plain-text environment variable"n* SECRET: A secret + plain-text environment variable * SECRET: A secret encrypted environment variable. Known values are: "GENERAL" and "SECRET". "value": "str" # Optional. @@ -85867,13 +89487,13 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "registry_credentials": "str", # Optional. The credentials to be able to pull the image. The value will be encrypted on first submission. On following - submissions, the encrypted value should be used."n"n"n* + submissions, the encrypted value should be used. * "$username:$access_token" for registries of type - ``DOCKER_HUB``."n* "$username:$access_token" for registries - of type ``GHCR``. + ``DOCKER_HUB``. * "$username:$access_token" for registries of + type ``GHCR``. "registry_type": "str", # Optional. - * DOCKER_HUB: The DockerHub container registry type."n* DOCR: - The DigitalOcean container registry type."n* GHCR: The Github + * DOCKER_HUB: The DockerHub container registry type. * DOCR: + The DigitalOcean container registry type. * GHCR: The Github container registry type. Known values are: "DOCKER_HUB", "DOCR", and "GHCR". "repository": "str", # Optional. The @@ -85895,6 +89515,7 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "apps-d-1vcpu-4gb", "apps-d-2vcpu-4gb", "apps-d-2vcpu-8gb", "apps-d-4vcpu-8gb", "apps-d-4vcpu-16gb", and "apps-d-8vcpu-32gb". "log_destinations": { + "name": "str", # Required. "datadog": { "api_key": "str", # Datadog API key. Required. @@ -85905,18 +89526,17 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: "token": "str" # Optional. Logtail token. }, - "name": "str", # Required. "open_search": { + "endpoint": "str", # + OpenSearch API Endpoint. Only HTTPS is supported. Format: + :code:``::code:``. Default port is 9300. + Required. "basic_auth": { "password": "str", # Password for user defined in User. Required. "user": "str" # Username to authenticate with. Required. }, - "endpoint": "str", # - OpenSearch API Endpoint. Only HTTPS is supported. Format: - :code:``::code:``. Default port is 9300. - Required. "index_name": "logs" # Optional. Default value is "logs". The index name to use for the logs. If not set, the default index name is @@ -85977,10 +89597,14 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -85989,25 +89613,28 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_revert_rollback_request( + _request = build_apps_revert_rollback_request( app_id=app_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86044,14 +89671,15 @@ def revert_rollback(self, app_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_metrics_bandwidth_daily( self, app_id: str, *, date: Optional[datetime.datetime] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve App Daily Bandwidth Metrics. Retrieve daily bandwidth usage metrics for a single app. @@ -86091,10 +89719,14 @@ def get_metrics_bandwidth_daily( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86103,26 +89735,29 @@ def get_metrics_bandwidth_daily( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_apps_get_metrics_bandwidth_daily_request( + _request = build_apps_get_metrics_bandwidth_daily_request( app_id=app_id, date=date, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86159,14 +89794,15 @@ def get_metrics_bandwidth_daily( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def list_metrics_bandwidth_daily( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Multiple Apps' Daily Bandwidth Metrics. Retrieve daily bandwidth usage metrics for multiple apps. @@ -86218,14 +89854,15 @@ def list_metrics_bandwidth_daily( @overload def list_metrics_bandwidth_daily( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Multiple Apps' Daily Bandwidth Metrics. Retrieve daily bandwidth usage metrics for multiple apps. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -86262,17 +89899,15 @@ def list_metrics_bandwidth_daily( @distributed_trace def list_metrics_bandwidth_daily( - self, body: Union[JSON, IO], **kwargs: Any + self, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Multiple Apps' Daily Bandwidth Metrics. Retrieve daily bandwidth usage metrics for multiple apps. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -86280,6 +89915,15 @@ def list_metrics_bandwidth_daily( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "app_ids": [ + "str" # A list of app IDs to query bandwidth metrics for. Required. + ], + "date": "2020-02-20 00:00:00" # Optional. Optional day to query. Only the + date component of the timestamp will be considered. Default: yesterday. + } + # response body for status code(s): 200 response == { "app_bandwidth_usage": [ @@ -86303,10 +89947,14 @@ def list_metrics_bandwidth_daily( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86315,38 +89963,41 @@ def list_metrics_bandwidth_daily( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_apps_list_metrics_bandwidth_daily_request( + _request = build_apps_list_metrics_bandwidth_daily_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86383,9 +90034,9 @@ def list_metrics_bandwidth_daily( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class CdnOperations: @@ -86411,6 +90062,7 @@ def __init__(self, *args, **kwargs): def list_endpoints( self, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All CDN Endpoints. To list all of the CDN endpoints available on your account, send a GET request to @@ -86429,8 +90081,14 @@ def list_endpoints( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "endpoints": [ { + "origin": "str", # The fully qualified domain name (FQDN) + for the origin server which provides the content for the CDN. This is + currently restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. @@ -86443,9 +90101,6 @@ def list_endpoints( name (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) - for the origin server which provides the content for the CDN. This is - currently restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) @@ -86454,16 +90109,17 @@ def list_endpoints( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86472,26 +90128,29 @@ def list_endpoints( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_cdn_list_endpoints_request( + _request = build_cdn_list_endpoints_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86511,14 +90170,15 @@ def list_endpoints( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_endpoint( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New CDN Endpoint. To create a new CDN endpoint, send a POST request to ``/v2/cdn/endpoints``. The @@ -86543,6 +90203,9 @@ def create_endpoint( # JSON input template you can fill out and use as your body input. body = { + "origin": "str", # The fully qualified domain name (FQDN) for the origin + server which provides the content for the CDN. This is currently restricted to a + Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given in @@ -86554,9 +90217,6 @@ def create_endpoint( which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the origin - server which provides the content for the CDN. This is currently restricted to a - Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded. Known @@ -86566,6 +90226,9 @@ def create_endpoint( # response body for status code(s): 201 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -86577,9 +90240,6 @@ def create_endpoint( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -86590,8 +90250,9 @@ def create_endpoint( @overload def create_endpoint( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New CDN Endpoint. To create a new CDN endpoint, send a POST request to ``/v2/cdn/endpoints``. The @@ -86603,7 +90264,7 @@ def create_endpoint( ``certificate_id`` attributes. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -86617,6 +90278,9 @@ def create_endpoint( # response body for status code(s): 201 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -86628,9 +90292,6 @@ def create_endpoint( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -86640,7 +90301,8 @@ def create_endpoint( """ @distributed_trace - def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create_endpoint(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New CDN Endpoint. To create a new CDN endpoint, send a POST request to ``/v2/cdn/endpoints``. The @@ -86651,11 +90313,8 @@ def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: A custom subdomain may be configured by specifying the ``custom_domain`` and ``certificate_id`` attributes. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -86663,9 +90322,34 @@ def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "origin": "str", # The fully qualified domain name (FQDN) for the origin + server which provides the content for the CDN. This is currently restricted to a + Space. Required. + "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS + certificate used for SSL when a custom subdomain is provided. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the CDN endpoint was + created. + "custom_domain": "str", # Optional. The fully qualified domain name (FQDN) + of the custom subdomain used with the CDN endpoint. + "endpoint": "str", # Optional. The fully qualified domain name (FQDN) from + which the CDN-backed content is served. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a CDN endpoint. + "ttl": 3600 # Optional. Default value is 3600. The amount of time the + content is cached by the CDN's edge servers in seconds. TTL must be one of 60, + 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded. Known + values are: 60, 600, 3600, 86400, and 604800. + } + # response body for status code(s): 201 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -86677,9 +90361,6 @@ def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -86687,10 +90368,14 @@ def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86699,38 +90384,41 @@ def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_cdn_create_endpoint_request( + _request = build_cdn_create_endpoint_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86750,12 +90438,13 @@ def create_endpoint(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing CDN Endpoint. To show information about an existing CDN endpoint, send a GET request to @@ -86773,6 +90462,9 @@ def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -86784,9 +90476,6 @@ def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -86805,10 +90494,14 @@ def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -86817,25 +90510,28 @@ def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_cdn_get_endpoint_request( + _request = build_cdn_get_endpoint_request( cdn_id=cdn_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -86872,9 +90568,9 @@ def get_endpoint(self, cdn_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_endpoints( @@ -86885,6 +90581,7 @@ def update_endpoints( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a CDN Endpoint. To update the TTL, certificate ID, or the FQDN of the custom subdomain for @@ -86920,6 +90617,9 @@ def update_endpoints( # response body for status code(s): 200 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -86931,9 +90631,6 @@ def update_endpoints( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -86957,11 +90654,12 @@ def update_endpoints( def update_endpoints( self, cdn_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a CDN Endpoint. To update the TTL, certificate ID, or the FQDN of the custom subdomain for @@ -86971,7 +90669,7 @@ def update_endpoints( :param cdn_id: A unique identifier for a CDN endpoint. Required. :type cdn_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -86985,6 +90683,9 @@ def update_endpoints( # response body for status code(s): 200 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -86996,9 +90697,6 @@ def update_endpoints( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -87020,8 +90718,9 @@ def update_endpoints( @distributed_trace def update_endpoints( - self, cdn_id: str, body: Union[JSON, IO], **kwargs: Any + self, cdn_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a CDN Endpoint. To update the TTL, certificate ID, or the FQDN of the custom subdomain for @@ -87030,11 +90729,8 @@ def update_endpoints( :param cdn_id: A unique identifier for a CDN endpoint. Required. :type cdn_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -87042,9 +90738,24 @@ def update_endpoints( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS + certificate used for SSL when a custom subdomain is provided. + "custom_domain": "str", # Optional. The fully qualified domain name (FQDN) + of the custom subdomain used with the CDN endpoint. + "ttl": 3600 # Optional. Default value is 3600. The amount of time the + content is cached by the CDN's edge servers in seconds. TTL must be one of 60, + 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded. Known + values are: 60, 600, 3600, 86400, and 604800. + } + # response body for status code(s): 200 response == { "endpoint": { + "origin": "str", # The fully qualified domain name (FQDN) for the + origin server which provides the content for the CDN. This is currently + restricted to a Space. Required. "certificate_id": "str", # Optional. The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. "created_at": "2020-02-20 00:00:00", # Optional. A time value given @@ -87056,9 +90767,6 @@ def update_endpoints( (FQDN) from which the CDN-backed content is served. "id": "str", # Optional. A unique ID that can be used to identify and reference a CDN endpoint. - "origin": "str", # The fully qualified domain name (FQDN) for the - origin server which provides the content for the CDN. This is currently - restricted to a Space. Required. "ttl": 3600 # Optional. Default value is 3600. The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when @@ -87077,10 +90785,14 @@ def update_endpoints( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87089,20 +90801,20 @@ def update_endpoints( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_cdn_update_endpoints_request( + _request = build_cdn_update_endpoints_request( cdn_id=cdn_id, content_type=content_type, json=_json, @@ -87110,18 +90822,21 @@ def update_endpoints( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -87158,12 +90873,13 @@ def update_endpoints( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_endpoint(self, cdn_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a CDN Endpoint. To delete a specific CDN endpoint, send a DELETE request to @@ -87193,10 +90909,14 @@ def delete_endpoint(self, cdn_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87205,25 +90925,28 @@ def delete_endpoint(self, cdn_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_cdn_delete_endpoint_request( + _request = build_cdn_delete_endpoint_request( cdn_id=cdn_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -87256,9 +90979,9 @@ def delete_endpoint(self, cdn_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def purge_cache( @@ -87269,12 +90992,13 @@ def purge_cache( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Purge the Cache for an Existing CDN Endpoint. To purge cached content from a CDN endpoint, send a DELETE request to ``/v2/cdn/endpoints/$ENDPOINT_ID/cache``. The body of the request should include a ``files`` attribute containing a list of cached file paths to be purged. A - path may be for a single file or may contain a wildcard (\ ``*``\ ) to recursively + path may be for a single file or may contain a wildcard (\\ ``*``\\ ) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. @@ -87318,17 +91042,18 @@ def purge_cache( def purge_cache( self, cdn_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Purge the Cache for an Existing CDN Endpoint. To purge cached content from a CDN endpoint, send a DELETE request to ``/v2/cdn/endpoints/$ENDPOINT_ID/cache``. The body of the request should include a ``files`` attribute containing a list of cached file paths to be purged. A - path may be for a single file or may contain a wildcard (\ ``*``\ ) to recursively + path may be for a single file or may contain a wildcard (\\ ``*``\\ ) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. @@ -87336,7 +91061,7 @@ def purge_cache( :param cdn_id: A unique identifier for a CDN endpoint. Required. :type cdn_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -87362,25 +91087,23 @@ def purge_cache( @distributed_trace def purge_cache( - self, cdn_id: str, body: Union[JSON, IO], **kwargs: Any + self, cdn_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Purge the Cache for an Existing CDN Endpoint. To purge cached content from a CDN endpoint, send a DELETE request to ``/v2/cdn/endpoints/$ENDPOINT_ID/cache``. The body of the request should include a ``files`` attribute containing a list of cached file paths to be purged. A - path may be for a single file or may contain a wildcard (\ ``*``\ ) to recursively + path may be for a single file or may contain a wildcard (\\ ``*``\\ ) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. :param cdn_id: A unique identifier for a CDN endpoint. Required. :type cdn_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -87388,6 +91111,14 @@ def purge_cache( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "files": [ + "str" # An array of strings containing the path to the content to be + purged from the CDN cache. Required. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -87400,10 +91131,14 @@ def purge_cache( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87412,20 +91147,20 @@ def purge_cache( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_cdn_purge_cache_request( + _request = build_cdn_purge_cache_request( cdn_id=cdn_id, content_type=content_type, json=_json, @@ -87433,18 +91168,21 @@ def purge_cache( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -87477,9 +91215,9 @@ def purge_cache( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class CertificatesOperations: @@ -87505,6 +91243,7 @@ def __init__(self, *args, **kwargs): def list( self, *, per_page: int = 20, page: int = 1, name: str = "", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Certificates. To list all of the certificates available on your account, send a GET request to @@ -87525,6 +91264,9 @@ def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "certificates": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -87555,16 +91297,17 @@ def list( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87573,27 +91316,30 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_certificates_list_request( + _request = build_certificates_list_request( per_page=per_page, page=page, name=name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -87613,21 +91359,22 @@ def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Certificate. To upload new SSL certificate which you have previously generated, send a POST request to ``/v2/certificates``. - When uploading a user-generated certificate, the ``private_key``\ , - ``leaf_certificate``\ , and optionally the ``certificate_chain`` attributes should + When uploading a user-generated certificate, the ``private_key``\\ , + ``leaf_certificate``\\ , and optionally the ``certificate_chain`` attributes should be provided. The type must be set to ``custom``. When using Let's Encrypt to create a certificate, the ``dns_names`` attribute @@ -87680,22 +91427,23 @@ def create( @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Certificate. To upload new SSL certificate which you have previously generated, send a POST request to ``/v2/certificates``. - When uploading a user-generated certificate, the ``private_key``\ , - ``leaf_certificate``\ , and optionally the ``certificate_chain`` attributes should + When uploading a user-generated certificate, the ``private_key``\\ , + ``leaf_certificate``\\ , and optionally the ``certificate_chain`` attributes should be provided. The type must be set to ``custom``. When using Let's Encrypt to create a certificate, the ``dns_names`` attribute must be provided, and the type must be set to ``lets_encrypt``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -87737,24 +91485,22 @@ def create( """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Certificate. To upload new SSL certificate which you have previously generated, send a POST request to ``/v2/certificates``. - When uploading a user-generated certificate, the ``private_key``\ , - ``leaf_certificate``\ , and optionally the ``certificate_chain`` attributes should + When uploading a user-generated certificate, the ``private_key``\\ , + ``leaf_certificate``\\ , and optionally the ``certificate_chain`` attributes should be provided. The type must be set to ``custom``. When using Let's Encrypt to create a certificate, the ``dns_names`` attribute must be provided, and the type must be set to ``lets_encrypt``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -87762,6 +91508,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "certificate": { @@ -87791,10 +91540,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87803,38 +91556,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_certificates_create_request( + _request = build_certificates_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -87854,12 +91610,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, certificate_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Certificate. To show information about an existing certificate, send a GET request to @@ -87914,10 +91671,14 @@ def get(self, certificate_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -87926,25 +91687,28 @@ def get(self, certificate_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_certificates_get_request( + _request = build_certificates_get_request( certificate_id=certificate_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -87981,12 +91745,13 @@ def get(self, certificate_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, certificate_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Certificate. To delete a specific certificate, send a DELETE request to @@ -88013,10 +91778,14 @@ def delete(self, certificate_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88025,25 +91794,28 @@ def delete(self, certificate_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_certificates_delete_request( + _request = build_certificates_delete_request( certificate_id=certificate_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -88076,9 +91848,9 @@ def delete(self, certificate_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class BalanceOperations: @@ -88102,6 +91874,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def get(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Customer Balance. To retrieve the balances on a customer's account, send a GET request to @@ -88138,10 +91911,14 @@ def get(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88150,24 +91927,27 @@ def get(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_balance_get_request( + _request = build_balance_get_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88204,9 +91984,9 @@ def get(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class BillingHistoryOperations: @@ -88230,6 +92010,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Billing History. To retrieve a list of all billing history entries, send a GET request to @@ -88244,6 +92025,9 @@ def list(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "billing_history": [ { "amount": "str", # Optional. Amount of the billing history @@ -88264,9 +92048,6 @@ def list(self, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -88281,10 +92062,14 @@ def list(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88293,24 +92078,27 @@ def list(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_billing_history_list_request( + _request = build_billing_history_list_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88347,9 +92135,9 @@ def list(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class InvoicesOperations: @@ -88373,6 +92161,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Invoices. To retrieve a list of all invoices, send a GET request to ``/v2/customers/my/invoices``. @@ -88390,6 +92179,9 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "invoice_preview": { "amount": "str", # Optional. Total amount of the invoice, in USD. This will reflect month-to-date usage in the invoice preview. @@ -88418,16 +92210,17 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88436,26 +92229,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_invoices_list_request( + _request = build_invoices_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88475,12 +92271,13 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Invoice by UUID. To retrieve the invoice items for an invoice, send a GET request to @@ -88497,6 +92294,9 @@ def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "invoice_items": [ { "amount": "str", # Optional. Billed amount of this invoice @@ -88526,9 +92326,6 @@ def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -88543,10 +92340,14 @@ def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88555,25 +92356,28 @@ def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_invoices_get_by_uuid_request( + _request = build_invoices_get_by_uuid_request( invoice_uuid=invoice_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88610,12 +92414,13 @@ def get_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_csv_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> Union[str, JSON]: + # pylint: disable=line-too-long """Retrieve an Invoice CSV by UUID. To retrieve a CSV for an invoice, send a GET request to @@ -88642,10 +92447,14 @@ def get_csv_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> Union[str, JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88654,25 +92463,28 @@ def get_csv_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> Union[str, JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Union[str, JSON]] + cls: ClsType[Union[str, JSON]] = kwargs.pop("cls", None) - request = build_invoices_get_csv_by_uuid_request( + _request = build_invoices_get_csv_by_uuid_request( invoice_uuid=invoice_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88712,18 +92524,15 @@ def get_csv_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> Union[str, JSON]: deserialized = None if cls: - return cls( - pipeline_response, - cast(Union[str, JSON], deserialized), - response_headers, - ) + return cls(pipeline_response, cast(Union[str, JSON], deserialized), response_headers) # type: ignore - return cast(Union[str, JSON], deserialized) + return cast(Union[str, JSON], deserialized) # type: ignore @distributed_trace def get_pdf_by_uuid( self, invoice_uuid: str, **kwargs: Any ) -> Union[Iterator[bytes], JSON]: + # pylint: disable=line-too-long """Retrieve an Invoice PDF by UUID. To retrieve a PDF for an invoice, send a GET request to @@ -88731,7 +92540,7 @@ def get_pdf_by_uuid( :param invoice_uuid: UUID of the invoice. Required. :type invoice_uuid: str - :return: Iterator of the response bytes or JSON object + :return: Iterator[bytes] or JSON object :rtype: Iterator[bytes] or JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -88750,10 +92559,14 @@ def get_pdf_by_uuid( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88762,25 +92575,28 @@ def get_pdf_by_uuid( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Union[Iterator[bytes], JSON]] + cls: ClsType[Union[Iterator[bytes], JSON]] = kwargs.pop("cls", None) - request = build_invoices_get_pdf_by_uuid_request( + _request = build_invoices_get_pdf_by_uuid_request( invoice_uuid=invoice_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=True, **kwargs + _stream = True + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88811,22 +92627,16 @@ def get_pdf_by_uuid( "int", response.headers.get("ratelimit-reset") ) - if response.content: - deserialized = response.json() - else: - deserialized = None + deserialized = response.iter_bytes() if cls: - return cls( - pipeline_response, - cast(Union[Iterator[bytes], JSON], deserialized), - response_headers, - ) + return cls(pipeline_response, cast(Union[Iterator[bytes], JSON], deserialized), response_headers) # type: ignore - return cast(Union[Iterator[bytes], JSON], deserialized) + return cast(Union[Iterator[bytes], JSON], deserialized) # type: ignore @distributed_trace def get_summary_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Invoice Summary by UUID. To retrieve a summary for an invoice, send a GET request to @@ -88904,10 +92714,14 @@ def get_summary_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -88916,25 +92730,28 @@ def get_summary_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_invoices_get_summary_by_uuid_request( + _request = build_invoices_get_summary_by_uuid_request( invoice_uuid=invoice_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -88971,9 +92788,9 @@ def get_summary_by_uuid(self, invoice_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class DatabasesOperations: # pylint: disable=too-many-public-methods @@ -88997,6 +92814,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list_options(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Database Options. To list all of the options available for the offered database engines, send a GET request to @@ -89251,10 +93069,14 @@ def list_options(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -89263,24 +93085,27 @@ def list_options(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_options_request( + _request = build_databases_list_options_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -89317,12 +93142,13 @@ def list_options(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Database Clusters. To list all of the database clusters available on your account, send a GET request to @@ -89355,6 +93181,19 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO response == { "databases": [ { + "engine": "str", # A slug representing the database engine + used for the cluster. The possible values are: "pg" for PostgreSQL, + "mysql" for MySQL, "redis" for Redis, "mongodb" for MongoDB, "kafka" for + Kafka and "opensearch" for Opensearch. Required. Known values are: "pg", + "mysql", "redis", "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to + a database cluster. Required. + "num_nodes": 0, # The number of nodes in the database + cluster. Required. + "region": "str", # The slug identifier for the region where + the database cluster is located. Required. + "size": "str", # The slug identifier representing the size + of the nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -89380,22 +93219,17 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine - used for the cluster. The possible values are: "pg" for PostgreSQL, - "mysql" for MySQL, "redis" for Redis, "mongodb" for MongoDB, "kafka" for - Kafka and "opensearch" for Opensearch. Required. Known values are: "pg", - "mysql", "redis", "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which + maintenance updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which - maintenance updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. @@ -89408,10 +93242,6 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO service is listening. } ], - "name": "str", # A unique, human-readable name referring to - a database cluster. Required. - "num_nodes": 0, # The number of nodes in the database - cluster. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -89437,31 +93267,27 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where - the database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique - ID for the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # - Optional. A time value given in ISO8601 combined date and time - format that represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for - the firewall rule itself. - "value": "str" # The ID of the specific + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique + ID for the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # + Optional. A time value given in ISO8601 combined date and time + format that represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for + the firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size - of the nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -89526,6 +93352,8 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO }, "users": [ { + "name": "str", # The name of a database + user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key @@ -89533,28 +93361,21 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO "mysql_settings": { "auth_plugin": "str" # A string specifying the authentication method to be used for - connections"nto the MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the - version of MySQL in use will be used. As of MySQL 8.0, - the"ndefault is ``caching_sha2_password``. Required. Known - values are: "mysql_native_password" and - "caching_sha2_password". + connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If + excluded when creating a new user, the default for the + version of MySQL in use will be used. As of MySQL 8.0, the + default is ``caching_sha2_password``. Required. Known values + are: "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database - user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string - representing the database user's role. The value will be - either"n"primary" or "normal". Known values are: "primary" and - "normal". + representing the database user's role. The value will be either + "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # - Optional. An identifier for the ACL. Will be computed - after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' @@ -89565,14 +93386,17 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # + Optional. An identifier for the ACL. Will be computed + after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user - with replication rights."nThis option is not currently + with replication rights. This option is not currently supported for other database engines. } } @@ -89601,10 +93425,14 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -89613,25 +93441,28 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_clusters_request( + _request = build_databases_list_clusters_request( tag_name=tag_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -89668,14 +93499,15 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_cluster( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Database Cluster. To create a database cluster, send a POST request to ``/v2/databases``. @@ -89711,12 +93543,24 @@ def create_cluster( # JSON input template you can fill out and use as your body input. body = { + "engine": "str", # A slug representing the database engine used for the + cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, "redis" + for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" for + Opensearch. Required. Known values are: "pg", "mysql", "redis", "mongodb", + "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a database + cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. Required. + "region": "str", # The slug identifier for the region where the database + cluster is located. Required. + "size": "str", # The slug identifier representing the size of the nodes in + the database cluster. Required. "backup_restore": { - "backup_created_at": "2020-02-20 00:00:00", # Optional. The - timestamp of an existing database cluster backup in ISO8601 combined date and - time format. The most recent backup will be used if excluded. - "database_name": "str" # The name of an existing database cluster + "database_name": "str", # The name of an existing database cluster from which the backup will be restored. Required. + "backup_created_at": "2020-02-20 00:00:00" # Optional. The timestamp + of an existing database cluster backup in ISO8601 combined date and time + format. The most recent backup will be used if excluded. }, "connection": { "database": "str", # Optional. The name of the default database. @@ -89740,22 +93584,17 @@ def create_cluster( "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for the - cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, "redis" - for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" for - Opensearch. Required. Known values are: "pg", "mysql", "redis", "mongodb", - "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance updates will + be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance updates will - be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -89767,9 +93606,6 @@ def create_cluster( listening. } ], - "name": "str", # A unique, human-readable name referring to a database - cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. Required. "private_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -89792,29 +93628,25 @@ def create_cluster( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the database - cluster is located. Required. "rules": [ { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. "cluster_uuid": "str", # Optional. A unique ID for the database cluster to which the rule is applied. "created_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the firewall rule was created. - "type": "str", # The type of resource that the firewall rule - allows to access the database cluster. Required. Known values are: - "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the firewall rule + "uuid": "str" # Optional. A unique ID for the firewall rule itself. - "value": "str" # The ID of the specific resource, the name - of a tag applied to a group of resources, or the IP address that the - firewall rule allows to access the database cluster. Required. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the nodes in - the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -89872,31 +93704,28 @@ def create_cluster( }, "users": [ { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of - MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. Known - values are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL + 8.0, the default is ``caching_sha2_password``. Required. Known values + are: "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or "normal". + database user's role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be @@ -89905,14 +93734,17 @@ def create_cluster( 'produceconsume' as well as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other database + rights. This option is not currently supported for other database engines. } } @@ -89930,6 +93762,19 @@ def create_cluster( # response body for status code(s): 201 response == { "database": { + "engine": "str", # A slug representing the database engine used for + the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, + "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" + for Opensearch. Required. Known values are: "pg", "mysql", "redis", + "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a + database cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. + Required. + "region": "str", # The slug identifier for the region where the + database cluster is located. Required. + "size": "str", # The slug identifier representing the size of the + nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -89953,22 +93798,17 @@ def create_cluster( "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for - the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, - "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" - for Opensearch. Required. Known values are: "pg", "mysql", "redis", - "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance + updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance - updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -89980,10 +93820,6 @@ def create_cluster( listening. } ], - "name": "str", # A unique, human-readable name referring to a - database cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -90007,30 +93843,26 @@ def create_cluster( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the - database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique ID for - the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # Optional. A - time value given in ISO8601 combined date and time format that - represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the - firewall rule itself. - "value": "str" # The ID of the specific resource, + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for + the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A + time value given in ISO8601 combined date and time format that + represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the + firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the - nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -90090,33 +93922,30 @@ def create_cluster( }, "users": [ { + "name": "str", # The name of a database user. + Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying - the authentication method to be used for connections"nto the - MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the version - of MySQL in use will be used. As of MySQL 8.0, the"ndefault is - ``caching_sha2_password``. Required. Known values are: - "mysql_native_password" and "caching_sha2_password". + the authentication method to be used for connections to the MySQL + user account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, + the default for the version of MySQL in use will be used. As of + MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and + "caching_sha2_password". }, - "name": "str", # The name of a database user. - Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or - "normal". Known values are: "primary" and "normal". + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows @@ -90126,15 +93955,18 @@ def create_cluster( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for - matching the topic(s) that this ACL should apply to. + "topic": "str", # A regex + for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other - database engines. + rights. This option is not currently supported for other database + engines. } } ], @@ -90164,8 +93996,9 @@ def create_cluster( @overload def create_cluster( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Database Cluster. To create a database cluster, send a POST request to ``/v2/databases``. @@ -90188,7 +94021,7 @@ def create_cluster( Note: Backups are not supported for Redis clusters. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -90202,6 +94035,19 @@ def create_cluster( # response body for status code(s): 201 response == { "database": { + "engine": "str", # A slug representing the database engine used for + the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, + "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" + for Opensearch. Required. Known values are: "pg", "mysql", "redis", + "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a + database cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. + Required. + "region": "str", # The slug identifier for the region where the + database cluster is located. Required. + "size": "str", # The slug identifier representing the size of the + nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -90225,22 +94071,17 @@ def create_cluster( "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for - the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, - "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" - for Opensearch. Required. Known values are: "pg", "mysql", "redis", - "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance + updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance - updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -90252,10 +94093,6 @@ def create_cluster( listening. } ], - "name": "str", # A unique, human-readable name referring to a - database cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -90279,30 +94116,26 @@ def create_cluster( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the - database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique ID for - the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # Optional. A - time value given in ISO8601 combined date and time format that - represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the - firewall rule itself. - "value": "str" # The ID of the specific resource, + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for + the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A + time value given in ISO8601 combined date and time format that + represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the + firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the - nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -90362,33 +94195,30 @@ def create_cluster( }, "users": [ { + "name": "str", # The name of a database user. + Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying - the authentication method to be used for connections"nto the - MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the version - of MySQL in use will be used. As of MySQL 8.0, the"ndefault is - ``caching_sha2_password``. Required. Known values are: - "mysql_native_password" and "caching_sha2_password". + the authentication method to be used for connections to the MySQL + user account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, + the default for the version of MySQL in use will be used. As of + MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and + "caching_sha2_password". }, - "name": "str", # The name of a database user. - Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or - "normal". Known values are: "primary" and "normal". + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows @@ -90398,15 +94228,18 @@ def create_cluster( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for - matching the topic(s) that this ACL should apply to. + "topic": "str", # A regex + for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other - database engines. + rights. This option is not currently supported for other database + engines. } } ], @@ -90435,7 +94268,8 @@ def create_cluster( """ @distributed_trace - def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Database Cluster. To create a database cluster, send a POST request to ``/v2/databases``. @@ -90457,11 +94291,8 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: forking a database in the control panel. Note: Backups are not supported for Redis clusters. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -90469,9 +94300,240 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "engine": "str", # A slug representing the database engine used for the + cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, "redis" + for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" for + Opensearch. Required. Known values are: "pg", "mysql", "redis", "mongodb", + "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a database + cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. Required. + "region": "str", # The slug identifier for the region where the database + cluster is located. Required. + "size": "str", # The slug identifier representing the size of the nodes in + the database cluster. Required. + "backup_restore": { + "database_name": "str", # The name of an existing database cluster + from which the backup will be restored. Required. + "backup_created_at": "2020-02-20 00:00:00" # Optional. The timestamp + of an existing database cluster backup in ISO8601 combined date and time + format. The most recent backup will be used if excluded. + }, + "connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the database cluster + was created. + "db_names": [ + "str" # Optional. An array of strings containing the names of + databases created in the database cluster. + ], + "id": "str", # Optional. A unique ID that can be used to identify and + reference a database cluster. + "maintenance_window": { + "day": "str", # The day of the week on which to apply maintenance + updates. Required. + "hour": "str", # The hour in UTC at which maintenance updates will + be applied in 24 hour format. Required. + "description": [ + "str" # Optional. A list of strings, each containing + information about a pending maintenance update. + ], + "pending": bool # Optional. A boolean value indicating whether any + maintenance is scheduled to be performed in the next window. + }, + "metrics_endpoints": [ + { + "host": "str", # Optional. A FQDN pointing to the database + cluster's node(s). + "port": 0 # Optional. The port on which a service is + listening. + } + ], + "private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "private_network_uuid": "str", # Optional. A string specifying the UUID of + the VPC to which the database cluster will be assigned. If excluded, the cluster + when creating a new database cluster, it will be assigned to your account's + default VPC for the region. + "project_id": "str", # Optional. The ID of the project that the database + cluster is assigned to. If excluded when creating a new database cluster, it will + be assigned to your default project. + "rules": [ + { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for the + database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the firewall rule + itself. + } + ], + "semantic_version": "str", # Optional. A string representing the semantic + version of the database engine in use for the cluster. + "standby_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "standby_private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "status": "str", # Optional. A string representing the current status of the + database cluster. Known values are: "creating", "online", "resizing", + "migrating", and "forking". + "storage_size_mib": 0, # Optional. Additional storage added to the cluster, + in MiB. If null, no additional storage is added to the cluster, beyond what is + provided as a base amount from the 'size' and any previously added additional + storage. + "tags": [ + "str" # Optional. An array of tags that have been applied to the + database cluster. + ], + "ui_connection": { + "host": "str", # Optional. The FQDN pointing to the opensearch + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the opensearch dashboard is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. This is provided as a convenience and + should be able to be constructed by the other attributes. + "user": "str" # Optional. The default user for the opensearch + dashboard. + }, + "users": [ + { + "name": "str", # The name of a database user. Required. + "access_cert": "str", # Optional. Access certificate for TLS + client authentication. (Kafka only). + "access_key": "str", # Optional. Access key for TLS client + authentication. (Kafka only). + "mysql_settings": { + "auth_plugin": "str" # A string specifying the + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL + 8.0, the default is ``caching_sha2_password``. Required. Known values + are: "mysql_native_password" and "caching_sha2_password". + }, + "password": "str", # Optional. A randomly generated password + for the database user. + "role": "str", # Optional. A string representing the + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". + "settings": { + "acl": [ + { + "permission": "str", # Permission + set applied to the ACL. 'consume' allows for messages to be + consumed from the topic. 'produce' allows for messages to be + published to the topic. 'produceconsume' allows for both + 'consume' and 'produce' permission. 'admin' allows for + 'produceconsume' as well as any operations to administer the + topic (delete, update). Required. Known values are: "admin", + "consume", "produce", and "produceconsume". + "topic": "str", # A regex for + matching the topic(s) that this ACL should apply to. + Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. + } + ], + "pg_allow_replication": bool # Optional. For + Postgres clusters, set to ``true`` for a user with replication + rights. This option is not currently supported for other database + engines. + } + } + ], + "version": "str", # Optional. A string representing the version of the + database engine in use for the cluster. + "version_end_of_availability": "str", # Optional. A timestamp referring to + the date when the particular version will no longer be available for creating new + clusters. If null, the version does not have an end of availability timeline. + "version_end_of_life": "str" # Optional. A timestamp referring to the date + when the particular version will no longer be supported. If null, the version + does not have an end of life timeline. + } + # response body for status code(s): 201 response == { "database": { + "engine": "str", # A slug representing the database engine used for + the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, + "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" + for Opensearch. Required. Known values are: "pg", "mysql", "redis", + "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a + database cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. + Required. + "region": "str", # The slug identifier for the region where the + database cluster is located. Required. + "size": "str", # The slug identifier representing the size of the + nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -90495,22 +94557,17 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for - the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, - "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" - for Opensearch. Required. Known values are: "pg", "mysql", "redis", - "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance + updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance - updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -90522,10 +94579,6 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: listening. } ], - "name": "str", # A unique, human-readable name referring to a - database cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -90549,30 +94602,26 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the - database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique ID for - the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # Optional. A - time value given in ISO8601 combined date and time format that - represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the - firewall rule itself. - "value": "str" # The ID of the specific resource, + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for + the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A + time value given in ISO8601 combined date and time format that + represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the + firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the - nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -90632,33 +94681,30 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: }, "users": [ { + "name": "str", # The name of a database user. + Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying - the authentication method to be used for connections"nto the - MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the version - of MySQL in use will be used. As of MySQL 8.0, the"ndefault is - ``caching_sha2_password``. Required. Known values are: - "mysql_native_password" and "caching_sha2_password". + the authentication method to be used for connections to the MySQL + user account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, + the default for the version of MySQL in use will be used. As of + MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and + "caching_sha2_password". }, - "name": "str", # The name of a database user. - Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or - "normal". Known values are: "primary" and "normal". + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows @@ -90668,15 +94714,18 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for - matching the topic(s) that this ACL should apply to. + "topic": "str", # A regex + for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other - database engines. + rights. This option is not currently supported for other database + engines. } } ], @@ -90703,10 +94752,14 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -90715,38 +94768,41 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_create_cluster_request( + _request = build_databases_create_cluster_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -90783,12 +94839,13 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Database Cluster. To show information about an existing database cluster, send a GET request to @@ -90817,6 +94874,19 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "database": { + "engine": "str", # A slug representing the database engine used for + the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, + "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" + for Opensearch. Required. Known values are: "pg", "mysql", "redis", + "mongodb", "kafka", and "opensearch". + "name": "str", # A unique, human-readable name referring to a + database cluster. Required. + "num_nodes": 0, # The number of nodes in the database cluster. + Required. + "region": "str", # The slug identifier for the region where the + database cluster is located. Required. + "size": "str", # The slug identifier representing the size of the + nodes in the database cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -90840,22 +94910,17 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: "str" # Optional. An array of strings containing the names of databases created in the database cluster. ], - "engine": "str", # A slug representing the database engine used for - the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, - "redis" for Redis, "mongodb" for MongoDB, "kafka" for Kafka and "opensearch" - for Opensearch. Required. Known values are: "pg", "mysql", "redis", - "mongodb", "kafka", and "opensearch". "id": "str", # Optional. A unique ID that can be used to identify and reference a database cluster. "maintenance_window": { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance + updates will be applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance - updates will be applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. }, @@ -90867,10 +94932,6 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: listening. } ], - "name": "str", # A unique, human-readable name referring to a - database cluster. Required. - "num_nodes": 0, # The number of nodes in the database cluster. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -90894,30 +94955,26 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project. - "region": "str", # The slug identifier for the region where the - database cluster is located. Required. "rules": [ { - "cluster_uuid": "str", # Optional. A unique ID for - the database cluster to which the rule is applied. - "created_at": "2020-02-20 00:00:00", # Optional. A - time value given in ISO8601 combined date and time format that - represents when the firewall rule was created. "type": "str", # The type of resource that the firewall rule allows to access the database cluster. Required. Known values are: "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the - firewall rule itself. - "value": "str" # The ID of the specific resource, + "value": "str", # The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for + the database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A + time value given in ISO8601 combined date and time format that + represents when the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the + firewall rule itself. } ], "semantic_version": "str", # Optional. A string representing the semantic version of the database engine in use for the cluster. - "size": "str", # The slug identifier representing the size of the - nodes in the database cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -90977,33 +95034,30 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: }, "users": [ { + "name": "str", # The name of a database user. + Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying - the authentication method to be used for connections"nto the - MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If - excluded when creating a new user, the"ndefault for the version - of MySQL in use will be used. As of MySQL 8.0, the"ndefault is - ``caching_sha2_password``. Required. Known values are: - "mysql_native_password" and "caching_sha2_password". + the authentication method to be used for connections to the MySQL + user account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, + the default for the version of MySQL in use will be used. As of + MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and + "caching_sha2_password". }, - "name": "str", # The name of a database user. - Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or - "normal". Known values are: "primary" and "normal". + database user's role. The value will be either "primary" or "normal". + Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows @@ -91013,15 +95067,18 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for - matching the topic(s) that this ACL should apply to. + "topic": "str", # A regex + for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other - database engines. + rights. This option is not currently supported for other database + engines. } } ], @@ -91048,10 +95105,14 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91060,25 +95121,28 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_cluster_request( + _request = build_databases_get_cluster_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -91115,14 +95179,15 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def destroy_cluster( self, database_cluster_uuid: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Destroy a Database Cluster. To destroy a specific database, send a DELETE request to ``/v2/databases/$DATABASE_ID``. @@ -91150,10 +95215,14 @@ def destroy_cluster( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91162,25 +95231,28 @@ def destroy_cluster( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_destroy_cluster_request( + _request = build_databases_destroy_cluster_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -91213,12 +95285,13 @@ def destroy_cluster( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_config(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Database Cluster Configuration. Shows configuration parameters for an existing database cluster by sending a GET request to @@ -91251,10 +95324,14 @@ def get_config(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91263,25 +95340,28 @@ def get_config(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_config_request( + _request = build_databases_get_config_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -91318,9 +95398,9 @@ def get_config(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def patch_config( @@ -91331,6 +95411,7 @@ def patch_config( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update the Database Configuration for an Existing Database. To update the configuration for an existing database cluster, send a PATCH request to @@ -91372,11 +95453,12 @@ def patch_config( def patch_config( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update the Database Configuration for an Existing Database. To update the configuration for an existing database cluster, send a PATCH request to @@ -91385,7 +95467,7 @@ def patch_config( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -91411,8 +95493,9 @@ def patch_config( @distributed_trace def patch_config( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update the Database Configuration for an Existing Database. To update the configuration for an existing database cluster, send a PATCH request to @@ -91420,11 +95503,8 @@ def patch_config( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -91432,6 +95512,11 @@ def patch_config( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "config": {} + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -91444,10 +95529,14 @@ def patch_config( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91456,20 +95545,20 @@ def patch_config( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_patch_config_request( + _request = build_databases_patch_config_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -91477,18 +95566,21 @@ def patch_config( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -91521,12 +95613,13 @@ def patch_config( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_ca(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve the Public Certificate. To retrieve the public certificate used to secure the connection to the database cluster send a @@ -91564,10 +95657,14 @@ def get_ca(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91576,25 +95673,28 @@ def get_ca(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_ca_request( + _request = build_databases_get_ca_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -91631,12 +95731,13 @@ def get_ca(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_migration_status(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve the Status of an Online Migration. To retrieve the status of the most recent online migration, send a GET request to @@ -91671,10 +95772,14 @@ def get_migration_status(self, database_cluster_uuid: str, **kwargs: Any) -> JSO tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91683,25 +95788,28 @@ def get_migration_status(self, database_cluster_uuid: str, **kwargs: Any) -> JSO _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_migration_status_request( + _request = build_databases_get_migration_status_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -91738,9 +95846,9 @@ def get_migration_status(self, database_cluster_uuid: str, **kwargs: Any) -> JSO deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_online_migration( @@ -91751,6 +95859,7 @@ def update_online_migration( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Start an Online Migration. To start an online migration, send a PUT request to @@ -91817,11 +95926,12 @@ def update_online_migration( def update_online_migration( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Start an Online Migration. To start an online migration, send a PUT request to @@ -91832,7 +95942,7 @@ def update_online_migration( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -91866,8 +95976,9 @@ def update_online_migration( @distributed_trace def update_online_migration( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Start an Online Migration. To start an online migration, send a PUT request to @@ -91877,11 +95988,8 @@ def update_online_migration( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -91889,6 +95997,26 @@ def update_online_migration( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "disable_ssl": bool, # Optional. Enables SSL encryption when connecting to + the source database. + "ignore_dbs": [ + "str" # Optional. List of databases that should be ignored during + migration. + ], + "source": { + "dbname": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "username": "str" # Optional. The default user for the database. + } + } + # response body for status code(s): 200 response == { "created_at": "str", # Optional. The time the migration was initiated, in @@ -91909,10 +96037,14 @@ def update_online_migration( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -91921,20 +96053,20 @@ def update_online_migration( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_online_migration_request( + _request = build_databases_update_online_migration_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -91942,18 +96074,21 @@ def update_online_migration( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -91990,14 +96125,15 @@ def update_online_migration( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_online_migration( self, database_cluster_uuid: str, migration_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Stop an Online Migration. To stop an online migration, send a DELETE request to @@ -92029,10 +96165,14 @@ def delete_online_migration( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -92041,26 +96181,29 @@ def delete_online_migration( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_online_migration_request( + _request = build_databases_delete_online_migration_request( database_cluster_uuid=database_cluster_uuid, migration_id=migration_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -92093,9 +96236,9 @@ def delete_online_migration( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def update_region( @@ -92106,6 +96249,7 @@ def update_region( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Migrate a Database Cluster to a New Region. To migrate a database cluster to a new region, send a ``PUT`` request to @@ -92154,11 +96298,55 @@ def update_region( def update_region( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Migrate a Database Cluster to a New Region. + + To migrate a database cluster to a new region, send a ``PUT`` request to + ``/v2/databases/$DATABASE_ID/migrate``. The body of the request must specify a + ``region`` attribute. + + A successful request will receive a 202 Accepted status code with no body in + response. Querying the database cluster will show that its ``status`` attribute + will now be set to ``migrating``. This will transition back to ``online`` when the + migration has completed. + + :param database_cluster_uuid: A unique identifier for a database cluster. Required. + :type database_cluster_uuid: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def update_region( + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> Optional[JSON]: + # pylint: disable=line-too-long """Migrate a Database Cluster to a New Region. To migrate a database cluster to a new region, send a ``PUT`` request to @@ -92170,10 +96358,203 @@ def update_region( will now be set to ``migrating``. This will transition back to ``online`` when the migration has completed. + :param database_cluster_uuid: A unique identifier for a database cluster. Required. + :type database_cluster_uuid: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "region": "str" # A slug identifier for the region to which the database + cluster will be migrated. Required. + } + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_databases_update_region_request( + database_cluster_uuid=database_cluster_uuid, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 404]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + deserialized = None + response_headers = {} + if response.status_code == 202: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.status_code == 404: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def update_cluster_size( + self, + database_cluster_uuid: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Resize a Database Cluster. + + To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The + body of the request must specify both the size and num_nodes attributes. + A successful request will receive a 202 Accepted status code with no body in response. Querying + the database cluster will show that its status attribute will now be set to resizing. This will + transition back to online when the resize operation has completed. + + :param database_cluster_uuid: A unique identifier for a database cluster. Required. + :type database_cluster_uuid: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object or None + :rtype: JSON or None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "num_nodes": 0, # The number of nodes in the database cluster. Valid values + are are 1-3. In addition to the primary node, up to two standby nodes may be + added for highly available configurations. Required. + "size": "str", # A slug identifier representing desired the size of the + nodes in the database cluster. Required. + "storage_size_mib": 0 # Optional. Additional storage added to the cluster, + in MiB. If null, no additional storage is added to the cluster, beyond what is + provided as a base amount from the 'size' and any previously added additional + storage. + } + + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def update_cluster_size( + self, + database_cluster_uuid: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> Optional[JSON]: + # pylint: disable=line-too-long + """Resize a Database Cluster. + + To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The + body of the request must specify both the size and num_nodes attributes. + A successful request will receive a 202 Accepted status code with no body in response. Querying + the database cluster will show that its status attribute will now be set to resizing. This will + transition back to online when the resize operation has completed. + :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -92198,136 +96579,10 @@ def update_region( """ @distributed_trace - def update_region( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any - ) -> Optional[JSON]: - """Migrate a Database Cluster to a New Region. - - To migrate a database cluster to a new region, send a ``PUT`` request to - ``/v2/databases/$DATABASE_ID/migrate``. The body of the request must specify a - ``region`` attribute. - - A successful request will receive a 202 Accepted status code with no body in - response. Querying the database cluster will show that its ``status`` attribute - will now be set to ``migrating``. This will transition back to ``online`` when the - migration has completed. - - :param database_cluster_uuid: A unique identifier for a database cluster. Required. - :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_databases_update_region_request( - database_cluster_uuid=database_cluster_uuid, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) - raise HttpResponseError(response=response) - - deserialized = None - response_headers = {} - if response.status_code == 202: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - @overload def update_cluster_size( - self, - database_cluster_uuid: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any, + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Resize a Database Cluster. To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The @@ -92338,11 +96593,8 @@ def update_cluster_size( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -92375,93 +96627,14 @@ def update_cluster_size( tickets to help identify the issue. } """ - - @overload - def update_cluster_size( - self, - database_cluster_uuid: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> Optional[JSON]: - """Resize a Database Cluster. - - To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The - body of the request must specify both the size and num_nodes attributes. - A successful request will receive a 202 Accepted status code with no body in response. Querying - the database cluster will show that its status attribute will now be set to resizing. This will - transition back to online when the resize operation has completed. - - :param database_cluster_uuid: A unique identifier for a database cluster. Required. - :type database_cluster_uuid: str - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace - def update_cluster_size( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any - ) -> Optional[JSON]: - """Resize a Database Cluster. - - To resize a database cluster, send a PUT request to ``/v2/databases/$DATABASE_ID/resize``. The - body of the request must specify both the size and num_nodes attributes. - A successful request will receive a 202 Accepted status code with no body in response. Querying - the database cluster will show that its status attribute will now be set to resizing. This will - transition back to online when the resize operation has completed. - - :param database_cluster_uuid: A unique identifier for a database cluster. Required. - :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -92470,20 +96643,20 @@ def update_cluster_size( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_cluster_size_request( + _request = build_databases_update_cluster_size_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -92491,18 +96664,21 @@ def update_cluster_size( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -92535,12 +96711,13 @@ def update_cluster_size( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_firewall_rules(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Firewall Rules (Trusted Sources) for a Database Cluster. To list all of a database cluster's firewall rules (known as "trusted sources" in the control @@ -92560,19 +96737,19 @@ def list_firewall_rules(self, database_cluster_uuid: str, **kwargs: Any) -> JSON response == { "rules": [ { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. "cluster_uuid": "str", # Optional. A unique ID for the database cluster to which the rule is applied. "created_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the firewall rule was created. - "type": "str", # The type of resource that the firewall rule - allows to access the database cluster. Required. Known values are: - "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the firewall rule + "uuid": "str" # Optional. A unique ID for the firewall rule itself. - "value": "str" # The ID of the specific resource, the name - of a tag applied to a group of resources, or the IP address that the - firewall rule allows to access the database cluster. Required. } ] } @@ -92588,10 +96765,14 @@ def list_firewall_rules(self, database_cluster_uuid: str, **kwargs: Any) -> JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -92600,25 +96781,28 @@ def list_firewall_rules(self, database_cluster_uuid: str, **kwargs: Any) -> JSON _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_firewall_rules_request( + _request = build_databases_list_firewall_rules_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -92655,9 +96839,9 @@ def list_firewall_rules(self, database_cluster_uuid: str, **kwargs: Any) -> JSON deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_firewall_rules( @@ -92668,6 +96852,7 @@ def update_firewall_rules( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Firewall Rules (Trusted Sources) for a Database. To update a database cluster's firewall rules (known as "trusted sources" in the control @@ -92698,19 +96883,19 @@ def update_firewall_rules( body = { "rules": [ { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. "cluster_uuid": "str", # Optional. A unique ID for the database cluster to which the rule is applied. "created_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the firewall rule was created. - "type": "str", # The type of resource that the firewall rule - allows to access the database cluster. Required. Known values are: - "droplet", "k8s", "ip_addr", "tag", and "app". - "uuid": "str", # Optional. A unique ID for the firewall rule + "uuid": "str" # Optional. A unique ID for the firewall rule itself. - "value": "str" # The ID of the specific resource, the name - of a tag applied to a group of resources, or the IP address that the - firewall rule allows to access the database cluster. Required. } ] } @@ -92732,11 +96917,12 @@ def update_firewall_rules( def update_firewall_rules( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Firewall Rules (Trusted Sources) for a Database. To update a database cluster's firewall rules (known as "trusted sources" in the control @@ -92752,7 +96938,7 @@ def update_firewall_rules( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -92778,8 +96964,9 @@ def update_firewall_rules( @distributed_trace def update_firewall_rules( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Firewall Rules (Trusted Sources) for a Database. To update a database cluster's firewall rules (known as "trusted sources" in the control @@ -92794,11 +96981,8 @@ def update_firewall_rules( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -92806,6 +96990,27 @@ def update_firewall_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "rules": [ + { + "type": "str", # The type of resource that the firewall rule + allows to access the database cluster. Required. Known values are: + "droplet", "k8s", "ip_addr", "tag", and "app". + "value": "str", # The ID of the specific resource, the name + of a tag applied to a group of resources, or the IP address that the + firewall rule allows to access the database cluster. Required. + "cluster_uuid": "str", # Optional. A unique ID for the + database cluster to which the rule is applied. + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the firewall rule was created. + "uuid": "str" # Optional. A unique ID for the firewall rule + itself. + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -92818,10 +97023,14 @@ def update_firewall_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -92830,20 +97039,20 @@ def update_firewall_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_firewall_rules_request( + _request = build_databases_update_firewall_rules_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -92851,18 +97060,21 @@ def update_firewall_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -92895,9 +97107,9 @@ def update_firewall_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def update_maintenance_window( @@ -92908,6 +97120,7 @@ def update_maintenance_window( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure a Database Cluster's Maintenance Window. To configure the window when automatic maintenance should be performed for a database cluster, @@ -92932,12 +97145,12 @@ def update_maintenance_window( body = { "day": "str", # The day of the week on which to apply maintenance updates. Required. + "hour": "str", # The hour in UTC at which maintenance updates will be + applied in 24 hour format. Required. "description": [ "str" # Optional. A list of strings, each containing information about a pending maintenance update. ], - "hour": "str", # The hour in UTC at which maintenance updates will be - applied in 24 hour format. Required. "pending": bool # Optional. A boolean value indicating whether any maintenance is scheduled to be performed in the next window. } @@ -92959,11 +97172,12 @@ def update_maintenance_window( def update_maintenance_window( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure a Database Cluster's Maintenance Window. To configure the window when automatic maintenance should be performed for a database cluster, @@ -92973,7 +97187,7 @@ def update_maintenance_window( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -92999,8 +97213,9 @@ def update_maintenance_window( @distributed_trace def update_maintenance_window( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure a Database Cluster's Maintenance Window. To configure the window when automatic maintenance should be performed for a database cluster, @@ -93009,11 +97224,8 @@ def update_maintenance_window( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -93021,6 +97233,20 @@ def update_maintenance_window( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "day": "str", # The day of the week on which to apply maintenance updates. + Required. + "hour": "str", # The hour in UTC at which maintenance updates will be + applied in 24 hour format. Required. + "description": [ + "str" # Optional. A list of strings, each containing information + about a pending maintenance update. + ], + "pending": bool # Optional. A boolean value indicating whether any + maintenance is scheduled to be performed in the next window. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -93033,10 +97259,14 @@ def update_maintenance_window( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93045,20 +97275,20 @@ def update_maintenance_window( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_maintenance_window_request( + _request = build_databases_update_maintenance_window_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -93066,18 +97296,21 @@ def update_maintenance_window( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -93110,17 +97343,18 @@ def update_maintenance_window( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_backups(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Backups for a Database Cluster. To list all of the available backups of a PostgreSQL or MySQL database cluster, send a GET request to ``/v2/databases/$DATABASE_ID/backups``. - **Note**\ : Backups are not supported for Redis clusters. + **Note**\\ : Backups are not supported for Redis clusters. The result will be a JSON object with a ``backups key``. This will be set to an array of backup objects, each of which will contain the size of the backup and the timestamp at which it was created. @@ -93158,10 +97392,14 @@ def list_backups(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93170,25 +97408,28 @@ def list_backups(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_backups_request( + _request = build_databases_list_backups_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -93225,18 +97466,19 @@ def list_backups(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Read-only Replicas. To list all of the read-only replicas associated with a database cluster, send a GET request to ``/v2/databases/$DATABASE_ID/replicas``. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The result will be a JSON object with a ``replicas`` key. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes. @@ -93254,6 +97496,8 @@ def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: response == { "replicas": [ { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -93277,8 +97521,6 @@ def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: the database cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -93335,10 +97577,14 @@ def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93347,25 +97593,28 @@ def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_replicas_request( + _request = build_databases_list_replicas_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -93402,9 +97651,9 @@ def list_replicas(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_replica( @@ -93415,13 +97664,14 @@ def create_replica( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a Read-only Replica. To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to ``/v2/databases/$DATABASE_ID/replicas`` specifying the name it should be given, the size of the node to be used, and the region where it will be located. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The response will be a JSON object with a key called ``replica``. The value of this will be an object that contains the standard attributes associated with a database replica. The initial @@ -93444,6 +97694,7 @@ def create_replica( # JSON input template you can fill out and use as your body input. body = { + "name": "str", # The name to give the read-only replicating. Required. "connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -93464,7 +97715,6 @@ def create_replica( was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. Required. "private_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -93506,6 +97756,8 @@ def create_replica( # response body for status code(s): 201 response == { "replica": { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -93527,8 +97779,6 @@ def create_replica( cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -93586,18 +97836,19 @@ def create_replica( def create_replica( self, database_cluster_uuid: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a Read-only Replica. To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to ``/v2/databases/$DATABASE_ID/replicas`` specifying the name it should be given, the size of the node to be used, and the region where it will be located. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The response will be a JSON object with a key called ``replica``. The value of this will be an object that contains the standard attributes associated with a database replica. The initial @@ -93607,7 +97858,7 @@ def create_replica( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -93621,6 +97872,8 @@ def create_replica( # response body for status code(s): 201 response == { "replica": { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -93642,8 +97895,6 @@ def create_replica( cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -93701,16 +97952,17 @@ def create_replica( def create_replica( self, database_cluster_uuid: str, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a Read-only Replica. To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to ``/v2/databases/$DATABASE_ID/replicas`` specifying the name it should be given, the size of the node to be used, and the region where it will be located. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The response will be a JSON object with a key called ``replica``. The value of this will be an object that contains the standard attributes associated with a database replica. The initial @@ -93719,11 +97971,8 @@ def create_replica( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -93731,9 +97980,72 @@ def create_replica( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # The name to give the read-only replicating. Required. + "connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the database cluster + was created. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a database replica. + "private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "private_network_uuid": "str", # Optional. A string specifying the UUID of + the VPC to which the read-only replica will be assigned. If excluded, the replica + will be assigned to your account's default VPC for the region. + "region": "str", # Optional. A slug identifier for the region where the + read-only replica will be located. If excluded, the replica will be placed in the + same region as the cluster. + "size": "str", # Optional. A slug identifier representing the size of the + node for the read-only replica. The size of the replica must be at least as large + as the node size for the database cluster from which it is replicating. + "status": "str", # Optional. A string representing the current status of the + database cluster. Known values are: "creating", "online", "resizing", + "migrating", and "forking". + "storage_size_mib": 0, # Optional. Additional storage added to the cluster, + in MiB. If null, no additional storage is added to the cluster, beyond what is + provided as a base amount from the 'size' and any previously added additional + storage. + "tags": [ + "str" # Optional. A flat array of tag names as strings to apply to + the read-only replica after it is created. Tag names can either be existing + or new tags. + ] + } + # response body for status code(s): 201 response == { "replica": { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -93755,8 +98067,6 @@ def create_replica( cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -93809,10 +98119,14 @@ def create_replica( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93821,15 +98135,15 @@ def create_replica( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -93837,7 +98151,7 @@ def create_replica( else: _json = None - request = build_databases_create_replica_request( + _request = build_databases_create_replica_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -93845,18 +98159,21 @@ def create_replica( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -93893,12 +98210,13 @@ def create_replica( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_events_logs(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List all Events Logs. To list all of the cluster events, send a GET request to @@ -93942,10 +98260,14 @@ def list_events_logs(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -93954,25 +98276,28 @@ def list_events_logs(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_events_logs_request( + _request = build_databases_list_events_logs_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94009,20 +98334,21 @@ def list_events_logs(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_replica( self, database_cluster_uuid: str, replica_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Read-only Replica. To show information about an existing database replica, send a GET request to ``/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME``. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. The response will be a JSON object with a ``replica key``. This will be set to an object containing the standard database replica attributes. @@ -94041,6 +98367,8 @@ def get_replica( # response body for status code(s): 200 response == { "replica": { + "name": "str", # The name to give the read-only replicating. + Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -94062,8 +98390,6 @@ def get_replica( cluster was created. "id": "str", # Optional. A unique ID that can be used to identify and reference a database replica. - "name": "str", # The name to give the read-only replicating. - Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -94116,10 +98442,14 @@ def get_replica( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94128,26 +98458,29 @@ def get_replica( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_replica_request( + _request = build_databases_get_replica_request( database_cluster_uuid=database_cluster_uuid, replica_name=replica_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94184,20 +98517,21 @@ def get_replica( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def destroy_replica( self, database_cluster_uuid: str, replica_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Destroy a Read-only Replica. To destroy a specific read-only replica, send a DELETE request to ``/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME``. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. @@ -94225,10 +98559,14 @@ def destroy_replica( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94237,26 +98575,29 @@ def destroy_replica( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_destroy_replica_request( + _request = build_databases_destroy_replica_request( database_cluster_uuid=database_cluster_uuid, replica_name=replica_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -94289,20 +98630,21 @@ def destroy_replica( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def promote_replica( self, database_cluster_uuid: str, replica_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Promote a Read-only Replica to become a Primary Cluster. To promote a specific read-only replica, send a PUT request to ``/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME/promote``. - **Note**\ : Read-only replicas are not supported for Redis clusters. + **Note**\\ : Read-only replicas are not supported for Redis clusters. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. @@ -94330,10 +98672,14 @@ def promote_replica( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94342,26 +98688,29 @@ def promote_replica( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_promote_replica_request( + _request = build_databases_promote_replica_request( database_cluster_uuid=database_cluster_uuid, replica_name=replica_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -94394,12 +98743,13 @@ def promote_replica( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List all Database Users. To list all of the users for your database cluster, send a GET request to @@ -94425,31 +98775,28 @@ def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: response == { "users": [ { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of - MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. Known - values are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL + 8.0, the default is ``caching_sha2_password``. Required. Known values + are: "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the - database user's role. The value will be either"n"primary" or "normal". + database user's role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An - identifier for the ACL. Will be computed after the ACL is - created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be @@ -94458,14 +98805,17 @@ def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: 'produceconsume' as well as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An + identifier for the ACL. Will be computed after the ACL is + created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set to ``true`` for a user with replication - rights."nThis option is not currently supported for other database + rights. This option is not currently supported for other database engines. } } @@ -94483,10 +98833,14 @@ def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94495,25 +98849,28 @@ def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_users_request( + _request = build_databases_list_users_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94550,9 +98907,9 @@ def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def add_user( @@ -94563,6 +98920,7 @@ def add_user( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Add a Database User. To add a new database user, send a POST request to ``/v2/databases/$DATABASE_ID/users`` @@ -94596,32 +98954,30 @@ def add_user( # JSON input template you can fill out and use as your body input. body = { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the authentication method - to be used for connections"nto the MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If excluded when - creating a new user, the"ndefault for the version of MySQL in use will be - used. As of MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. + to be used for connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If excluded when + creating a new user, the default for the version of MySQL in use will be + used. As of MySQL 8.0, the default is ``caching_sha2_password``. Required. Known values are: "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "readonly": bool, # Optional. For MongoDB clusters, set to ``true`` to - create a read-only user."nThis option is not currently supported for other + create a read-only user. This option is not currently supported for other database engines. "role": "str", # Optional. A string representing the database user's role. - The value will be either"n"primary" or "normal". Known values are: "primary" and + The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for the ACL. - Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to the topic. @@ -94629,12 +98985,14 @@ def add_user( 'admin' allows for 'produceconsume' as well as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the topic(s) + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for the ACL. + Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights."nThis option is not currently + to ``true`` for a user with replication rights. This option is not currently supported for other database engines. } } @@ -94642,30 +99000,28 @@ def add_user( # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -94674,13 +99030,15 @@ def add_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -94701,11 +99059,12 @@ def add_user( def add_user( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Add a Database User. To add a new database user, send a POST request to ``/v2/databases/$DATABASE_ID/users`` @@ -94726,7 +99085,7 @@ def add_user( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -94740,30 +99099,28 @@ def add_user( # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -94772,13 +99129,15 @@ def add_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -94797,8 +99156,9 @@ def add_user( @distributed_trace def add_user( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a Database User. To add a new database user, send a POST request to ``/v2/databases/$DATABASE_ID/users`` @@ -94818,11 +99178,8 @@ def add_user( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -94830,33 +99187,76 @@ def add_user( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # The name of a database user. Required. + "access_cert": "str", # Optional. Access certificate for TLS client + authentication. (Kafka only). + "access_key": "str", # Optional. Access key for TLS client authentication. + (Kafka only). + "mysql_settings": { + "auth_plugin": "str" # A string specifying the authentication method + to be used for connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If excluded when + creating a new user, the default for the version of MySQL in use will be + used. As of MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and "caching_sha2_password". + }, + "password": "str", # Optional. A randomly generated password for the + database user. + "readonly": bool, # Optional. For MongoDB clusters, set to ``true`` to + create a read-only user. This option is not currently supported for other + database engines. + "role": "str", # Optional. A string representing the database user's role. + The value will be either "primary" or "normal". Known values are: "primary" and + "normal". + "settings": { + "acl": [ + { + "permission": "str", # Permission set applied to the + ACL. 'consume' allows for messages to be consumed from the topic. + 'produce' allows for messages to be published to the topic. + 'produceconsume' allows for both 'consume' and 'produce' permission. + 'admin' allows for 'produceconsume' as well as any operations to + administer the topic (delete, update). Required. Known values are: + "admin", "consume", "produce", and "produceconsume". + "topic": "str", # A regex for matching the topic(s) + that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for the ACL. + Will be computed after the ACL is created/updated. + } + ], + "pg_allow_replication": bool # Optional. For Postgres clusters, set + to ``true`` for a user with replication rights. This option is not currently + supported for other database engines. + } + } + # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -94865,13 +99265,15 @@ def add_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -94887,10 +99289,14 @@ def add_user( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -94899,20 +99305,20 @@ def add_user( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_add_user_request( + _request = build_databases_add_user_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -94920,18 +99326,21 @@ def add_user( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -94968,14 +99377,15 @@ def add_user( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_user( self, database_cluster_uuid: str, username: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Database User. To show information about an existing database user, send a GET request to @@ -95005,30 +99415,28 @@ def get_user( # response body for status code(s): 200 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -95037,13 +99445,15 @@ def get_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -95059,10 +99469,14 @@ def get_user( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -95071,26 +99485,29 @@ def get_user( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_user_request( + _request = build_databases_get_user_request( database_cluster_uuid=database_cluster_uuid, username=username, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -95127,14 +99544,15 @@ def get_user( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_user( self, database_cluster_uuid: str, username: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove a Database User. To remove a specific database user, send a DELETE request to @@ -95168,10 +99586,14 @@ def delete_user( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -95180,26 +99602,29 @@ def delete_user( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_user_request( + _request = build_databases_delete_user_request( database_cluster_uuid=database_cluster_uuid, username=username, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -95232,9 +99657,9 @@ def delete_user( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def update_user( @@ -95246,13 +99671,14 @@ def update_user( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Database User. To update an existing database user, send a PUT request to ``/v2/databases/$DATABASE_ID/users/$USERNAME`` with the desired settings. - **Note**\ : only ``settings`` can be updated via this type of request. If you wish to change + **Note**\\ : only ``settings`` can be updated via this type of request. If you wish to change the name of a user, you must recreate a new user. @@ -95282,8 +99708,6 @@ def update_user( "settings": { "acl": [ { - "id": "str", # Optional. An identifier for the ACL. - Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to the topic. @@ -95291,12 +99715,14 @@ def update_user( 'admin' allows for 'produceconsume' as well as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the topic(s) + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for the ACL. + Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights."nThis option is not currently + to ``true`` for a user with replication rights. This option is not currently supported for other database engines. } } @@ -95304,30 +99730,28 @@ def update_user( # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -95336,13 +99760,15 @@ def update_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -95364,18 +99790,19 @@ def update_user( self, database_cluster_uuid: str, username: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Database User. To update an existing database user, send a PUT request to ``/v2/databases/$DATABASE_ID/users/$USERNAME`` with the desired settings. - **Note**\ : only ``settings`` can be updated via this type of request. If you wish to change + **Note**\\ : only ``settings`` can be updated via this type of request. If you wish to change the name of a user, you must recreate a new user. @@ -95389,7 +99816,7 @@ def update_user( :param username: The name of the database user. Required. :type username: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -95403,30 +99830,28 @@ def update_user( # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -95435,13 +99860,15 @@ def update_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -95463,16 +99890,17 @@ def update_user( self, database_cluster_uuid: str, username: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Database User. To update an existing database user, send a PUT request to ``/v2/databases/$DATABASE_ID/users/$USERNAME`` with the desired settings. - **Note**\ : only ``settings`` can be updated via this type of request. If you wish to change + **Note**\\ : only ``settings`` can be updated via this type of request. If you wish to change the name of a user, you must recreate a new user. @@ -95485,11 +99913,8 @@ def update_user( :type database_cluster_uuid: str :param username: The name of the database user. Required. :type username: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -95497,33 +99922,55 @@ def update_user( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "settings": { + "acl": [ + { + "permission": "str", # Permission set applied to the + ACL. 'consume' allows for messages to be consumed from the topic. + 'produce' allows for messages to be published to the topic. + 'produceconsume' allows for both 'consume' and 'produce' permission. + 'admin' allows for 'produceconsume' as well as any operations to + administer the topic (delete, update). Required. Known values are: + "admin", "consume", "produce", and "produceconsume". + "topic": "str", # A regex for matching the topic(s) + that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for the ACL. + Will be computed after the ACL is created/updated. + } + ], + "pg_allow_replication": bool # Optional. For Postgres clusters, set + to ``true`` for a user with replication rights. This option is not currently + supported for other database engines. + } + } + # response body for status code(s): 201 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -95532,13 +99979,15 @@ def update_user( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -95554,10 +100003,14 @@ def update_user( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -95566,20 +100019,20 @@ def update_user( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_user_request( + _request = build_databases_update_user_request( database_cluster_uuid=database_cluster_uuid, username=username, content_type=content_type, @@ -95588,18 +100041,21 @@ def update_user( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -95636,9 +100092,9 @@ def update_user( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def reset_auth( @@ -95650,6 +100106,7 @@ def reset_auth( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Reset a Database User's Password or Authentication Method. To reset the password for a database user, send a POST request to @@ -95682,10 +100139,10 @@ def reset_auth( body = { "mysql_settings": { "auth_plugin": "str" # A string specifying the authentication method - to be used for connections"nto the MySQL user account. The valid values are - ``mysql_native_password``"nor ``caching_sha2_password``. If excluded when - creating a new user, the"ndefault for the version of MySQL in use will be - used. As of MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. + to be used for connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If excluded when + creating a new user, the default for the version of MySQL in use will be + used. As of MySQL 8.0, the default is ``caching_sha2_password``. Required. Known values are: "mysql_native_password" and "caching_sha2_password". } } @@ -95693,30 +100150,28 @@ def reset_auth( # response body for status code(s): 200 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -95725,13 +100180,15 @@ def reset_auth( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -95753,11 +100210,12 @@ def reset_auth( self, database_cluster_uuid: str, username: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Reset a Database User's Password or Authentication Method. To reset the password for a database user, send a POST request to @@ -95775,7 +100233,7 @@ def reset_auth( :param username: The name of the database user. Required. :type username: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -95789,30 +100247,28 @@ def reset_auth( # response body for status code(s): 200 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -95821,13 +100277,15 @@ def reset_auth( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -95849,9 +100307,10 @@ def reset_auth( self, database_cluster_uuid: str, username: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Reset a Database User's Password or Authentication Method. To reset the password for a database user, send a POST request to @@ -95868,11 +100327,8 @@ def reset_auth( :type database_cluster_uuid: str :param username: The name of the database user. Required. :type username: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -95880,33 +100336,43 @@ def reset_auth( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "mysql_settings": { + "auth_plugin": "str" # A string specifying the authentication method + to be used for connections to the MySQL user account. The valid values are + ``mysql_native_password`` or ``caching_sha2_password``. If excluded when + creating a new user, the default for the version of MySQL in use will be + used. As of MySQL 8.0, the default is ``caching_sha2_password``. Required. + Known values are: "mysql_native_password" and "caching_sha2_password". + } + } + # response body for status code(s): 200 response == { "user": { + "name": "str", # The name of a database user. Required. "access_cert": "str", # Optional. Access certificate for TLS client authentication. (Kafka only). "access_key": "str", # Optional. Access key for TLS client authentication. (Kafka only). "mysql_settings": { "auth_plugin": "str" # A string specifying the - authentication method to be used for connections"nto the MySQL user - account. The valid values are ``mysql_native_password``"nor - ``caching_sha2_password``. If excluded when creating a new user, - the"ndefault for the version of MySQL in use will be used. As of MySQL - 8.0, the"ndefault is ``caching_sha2_password``. Required. Known values - are: "mysql_native_password" and "caching_sha2_password". + authentication method to be used for connections to the MySQL user + account. The valid values are ``mysql_native_password`` or + ``caching_sha2_password``. If excluded when creating a new user, the + default for the version of MySQL in use will be used. As of MySQL 8.0, + the default is ``caching_sha2_password``. Required. Known values are: + "mysql_native_password" and "caching_sha2_password". }, - "name": "str", # The name of a database user. Required. "password": "str", # Optional. A randomly generated password for the database user. "role": "str", # Optional. A string representing the database user's - role. The value will be either"n"primary" or "normal". Known values are: + role. The value will be either "primary" or "normal". Known values are: "primary" and "normal". "settings": { "acl": [ { - "id": "str", # Optional. An identifier for - the ACL. Will be computed after the ACL is created/updated. "permission": "str", # Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to @@ -95915,13 +100381,15 @@ def reset_auth( as any operations to administer the topic (delete, update). Required. Known values are: "admin", "consume", "produce", and "produceconsume". - "topic": "str" # A regex for matching the + "topic": "str", # A regex for matching the topic(s) that this ACL should apply to. Required. + "id": "str" # Optional. An identifier for + the ACL. Will be computed after the ACL is created/updated. } ], "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights."nThis - option is not currently supported for other database engines. + clusters, set to ``true`` for a user with replication rights. This option + is not currently supported for other database engines. } } } @@ -95937,10 +100405,14 @@ def reset_auth( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -95949,20 +100421,20 @@ def reset_auth( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_reset_auth_request( + _request = build_databases_reset_auth_request( database_cluster_uuid=database_cluster_uuid, username=username, content_type=content_type, @@ -95971,18 +100443,21 @@ def reset_auth( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96019,12 +100494,13 @@ def reset_auth( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Databases. To list all of the databases in a clusters, send a GET request to @@ -96064,10 +100540,14 @@ def list(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96076,25 +100556,28 @@ def list(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_request( + _request = build_databases_list_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96131,9 +100614,9 @@ def list(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def add( @@ -96144,6 +100627,7 @@ def add( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Add a New Database. To add a new database to an existing cluster, send a POST request to @@ -96196,11 +100680,12 @@ def add( def add( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Add a New Database. To add a new database to an existing cluster, send a POST request to @@ -96214,7 +100699,7 @@ def add( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -96246,8 +100731,9 @@ def add( @distributed_trace def add( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a New Database. To add a new database to an existing cluster, send a POST request to @@ -96260,11 +100746,8 @@ def add( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -96272,6 +100755,11 @@ def add( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # The name of the database. Required. + } + # response body for status code(s): 201 response == { "db": { @@ -96290,10 +100778,14 @@ def add( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96302,20 +100794,20 @@ def add( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_add_request( + _request = build_databases_add_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -96323,18 +100815,21 @@ def add( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96371,14 +100866,15 @@ def add( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get( self, database_cluster_uuid: str, database_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Database. To show information about an existing database cluster, send a GET request to @@ -96418,10 +100914,14 @@ def get( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96430,26 +100930,29 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_request( + _request = build_databases_get_request( database_cluster_uuid=database_cluster_uuid, database_name=database_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96486,14 +100989,15 @@ def get( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete( self, database_cluster_uuid: str, database_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Database. To delete a specific database, send a DELETE request to @@ -96527,10 +101031,14 @@ def delete( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96539,26 +101047,29 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_request( + _request = build_databases_delete_request( database_cluster_uuid=database_cluster_uuid, database_name=database_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -96591,12 +101102,13 @@ def delete( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_connection_pools(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Connection Pools (PostgreSQL). To list all of the connection pools available to a PostgreSQL database cluster, send a GET @@ -96617,6 +101129,20 @@ def list_connection_pools(self, database_cluster_uuid: str, **kwargs: Any) -> JS response == { "pools": [ { + "db": "str", # The database for use with the connection + pool. Required. + "mode": "str", # The PGBouncer transaction mode for the + connection pool. The allowed values are session, transaction, and + statement. Required. + "name": "str", # A unique name for the connection pool. Must + be between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection + pool. The maximum allowed size is determined by the size of the cluster's + primary node. 25 backend server connections are allowed for every 1GB of + RAM. Three are reserved for maintenance. For example, a primary node with + 1 GB of RAM allows for a maximum of 22 backend server connections while + one with 4 GB would allow for 97. Note that these are shared across all + connection pools in a cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -96635,13 +101161,6 @@ def list_connection_pools(self, database_cluster_uuid: str, **kwargs: Any) -> JS "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection - pool. Required. - "mode": "str", # The PGBouncer transaction mode for the - connection pool. The allowed values are session, transaction, and - statement. Required. - "name": "str", # A unique name for the connection pool. Must - be between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -96660,13 +101179,6 @@ def list_connection_pools(self, database_cluster_uuid: str, **kwargs: Any) -> JS "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection - pool. The maximum allowed size is determined by the size of the cluster's - primary node. 25 backend server connections are allowed for every 1GB of - RAM. Three are reserved for maintenance. For example, a primary node with - 1 GB of RAM allows for a maximum of 22 backend server connections while - one with 4 GB would allow for 97. Note that these are shared across all - connection pools in a cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -96721,10 +101233,14 @@ def list_connection_pools(self, database_cluster_uuid: str, **kwargs: Any) -> JS tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -96733,25 +101249,28 @@ def list_connection_pools(self, database_cluster_uuid: str, **kwargs: Any) -> JS _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_connection_pools_request( + _request = build_databases_list_connection_pools_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -96788,9 +101307,9 @@ def list_connection_pools(self, database_cluster_uuid: str, **kwargs: Any) -> JS deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def add_connection_pool( @@ -96801,6 +101320,7 @@ def add_connection_pool( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Add a New Connection Pool (PostgreSQL). For PostgreSQL database clusters, connection pools can be used to allow a @@ -96831,6 +101351,17 @@ def add_connection_pool( # JSON input template you can fill out and use as your body input. body = { + "db": "str", # The database for use with the connection pool. Required. + "mode": "str", # The PGBouncer transaction mode for the connection pool. The + allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be between 3 + and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The maximum + allowed size is determined by the size of the cluster's primary node. 25 backend + server connections are allowed for every 1GB of RAM. Three are reserved for + maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of + 22 backend server connections while one with 4 GB would allow for 97. Note that + these are shared across all connection pools in a cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -96846,11 +101377,6 @@ def add_connection_pool( to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. Required. - "mode": "str", # The PGBouncer transaction mode for the connection pool. The - allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be between 3 - and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -96866,12 +101392,6 @@ def add_connection_pool( to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The maximum - allowed size is determined by the size of the cluster's primary node. 25 backend - server connections are allowed for every 1GB of RAM. Three are reserved for - maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of - 22 backend server connections while one with 4 GB would allow for 97. Note that - these are shared across all connection pools in a cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. "host": "str", # Optional. The FQDN pointing to the database @@ -96909,6 +101429,19 @@ def add_connection_pool( # response body for status code(s): 201 response == { "pool": { + "db": "str", # The database for use with the connection pool. + Required. + "mode": "str", # The PGBouncer transaction mode for the connection + pool. The allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be + between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The + maximum allowed size is determined by the size of the cluster's primary node. + 25 backend server connections are allowed for every 1GB of RAM. Three are + reserved for maintenance. For example, a primary node with 1 GB of RAM allows + for a maximum of 22 backend server connections while one with 4 GB would + allow for 97. Note that these are shared across all connection pools in a + cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -96925,12 +101458,6 @@ def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. - Required. - "mode": "str", # The PGBouncer transaction mode for the connection - pool. The allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be - between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -96947,13 +101474,6 @@ def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The - maximum allowed size is determined by the size of the cluster's primary node. - 25 backend server connections are allowed for every 1GB of RAM. Three are - reserved for maintenance. For example, a primary node with 1 GB of RAM allows - for a maximum of 22 backend server connections while one with 4 GB would - allow for 97. Note that these are shared across all connection pools in a - cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -97008,11 +101528,12 @@ def add_connection_pool( def add_connection_pool( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Add a New Connection Pool (PostgreSQL). For PostgreSQL database clusters, connection pools can be used to allow a @@ -97030,7 +101551,7 @@ def add_connection_pool( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -97044,6 +101565,19 @@ def add_connection_pool( # response body for status code(s): 201 response == { "pool": { + "db": "str", # The database for use with the connection pool. + Required. + "mode": "str", # The PGBouncer transaction mode for the connection + pool. The allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be + between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The + maximum allowed size is determined by the size of the cluster's primary node. + 25 backend server connections are allowed for every 1GB of RAM. Three are + reserved for maintenance. For example, a primary node with 1 GB of RAM allows + for a maximum of 22 backend server connections while one with 4 GB would + allow for 97. Note that these are shared across all connection pools in a + cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -97060,12 +101594,6 @@ def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. - Required. - "mode": "str", # The PGBouncer transaction mode for the connection - pool. The allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be - between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -97082,13 +101610,6 @@ def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The - maximum allowed size is determined by the size of the cluster's primary node. - 25 backend server connections are allowed for every 1GB of RAM. Three are - reserved for maintenance. For example, a primary node with 1 GB of RAM allows - for a maximum of 22 backend server connections while one with 4 GB would - allow for 97. Note that these are shared across all connection pools in a - cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -97141,8 +101662,9 @@ def add_connection_pool( @distributed_trace def add_connection_pool( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a New Connection Pool (PostgreSQL). For PostgreSQL database clusters, connection pools can be used to allow a @@ -97159,11 +101681,8 @@ def add_connection_pool( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -97171,9 +101690,99 @@ def add_connection_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "db": "str", # The database for use with the connection pool. Required. + "mode": "str", # The PGBouncer transaction mode for the connection pool. The + allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be between 3 + and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The maximum + allowed size is determined by the size of the cluster's primary node. 25 backend + server connections are allowed for every 1GB of RAM. Three are reserved for + maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of + 22 backend server connections while one with 4 GB would allow for 97. Note that + these are shared across all connection pools in a cluster. Required. + "connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "standby_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "standby_private_connection": { + "database": "str", # Optional. The name of the default database. + "host": "str", # Optional. The FQDN pointing to the database + cluster's current primary node. + "password": "str", # Optional. The randomly generated password for + the default user. + "port": 0, # Optional. The port on which the database cluster is + listening. + "ssl": bool, # Optional. A boolean value indicating if the + connection should be made over SSL. + "uri": "str", # Optional. A connection string in the format accepted + by the ``psql`` command. This is provided as a convenience and should be able + to be constructed by the other attributes. + "user": "str" # Optional. The default user for the database. + }, + "user": "str" # Optional. The name of the user for use with the connection + pool. When excluded, all sessions connect to the database as the inbound user. + } + # response body for status code(s): 201 response == { "pool": { + "db": "str", # The database for use with the connection pool. + Required. + "mode": "str", # The PGBouncer transaction mode for the connection + pool. The allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be + between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The + maximum allowed size is determined by the size of the cluster's primary node. + 25 backend server connections are allowed for every 1GB of RAM. Three are + reserved for maintenance. For example, a primary node with 1 GB of RAM allows + for a maximum of 22 backend server connections while one with 4 GB would + allow for 97. Note that these are shared across all connection pools in a + cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -97190,12 +101799,6 @@ def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. - Required. - "mode": "str", # The PGBouncer transaction mode for the connection - pool. The allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be - between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -97212,13 +101815,6 @@ def add_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The - maximum allowed size is determined by the size of the cluster's primary node. - 25 backend server connections are allowed for every 1GB of RAM. Three are - reserved for maintenance. For example, a primary node with 1 GB of RAM allows - for a maximum of 22 backend server connections while one with 4 GB would - allow for 97. Note that these are shared across all connection pools in a - cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -97268,10 +101864,14 @@ def add_connection_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97280,20 +101880,20 @@ def add_connection_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_add_connection_pool_request( + _request = build_databases_add_connection_pool_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -97301,18 +101901,21 @@ def add_connection_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -97349,14 +101952,15 @@ def add_connection_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_connection_pool( self, database_cluster_uuid: str, pool_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Existing Connection Pool (PostgreSQL). To show information about an existing connection pool for a PostgreSQL database cluster, send a @@ -97377,6 +101981,19 @@ def get_connection_pool( # response body for status code(s): 200 response == { "pool": { + "db": "str", # The database for use with the connection pool. + Required. + "mode": "str", # The PGBouncer transaction mode for the connection + pool. The allowed values are session, transaction, and statement. Required. + "name": "str", # A unique name for the connection pool. Must be + between 3 and 60 characters. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The + maximum allowed size is determined by the size of the cluster's primary node. + 25 backend server connections are allowed for every 1GB of RAM. Three are + reserved for maintenance. For example, a primary node with 1 GB of RAM allows + for a maximum of 22 backend server connections while one with 4 GB would + allow for 97. Note that these are shared across all connection pools in a + cluster. Required. "connection": { "database": "str", # Optional. The name of the default database. @@ -97393,12 +102010,6 @@ def get_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "db": "str", # The database for use with the connection pool. - Required. - "mode": "str", # The PGBouncer transaction mode for the connection - pool. The allowed values are session, transaction, and statement. Required. - "name": "str", # A unique name for the connection pool. Must be - between 3 and 60 characters. Required. "private_connection": { "database": "str", # Optional. The name of the default database. @@ -97415,13 +102026,6 @@ def get_connection_pool( should be able to be constructed by the other attributes. "user": "str" # Optional. The default user for the database. }, - "size": 0, # The desired size of the PGBouncer connection pool. The - maximum allowed size is determined by the size of the cluster's primary node. - 25 backend server connections are allowed for every 1GB of RAM. Three are - reserved for maintenance. For example, a primary node with 1 GB of RAM allows - for a maximum of 22 backend server connections while one with 4 GB would - allow for 97. Note that these are shared across all connection pools in a - cluster. Required. "standby_connection": { "database": "str", # Optional. The name of the default database. @@ -97471,10 +102075,14 @@ def get_connection_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97483,26 +102091,29 @@ def get_connection_pool( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_connection_pool_request( + _request = build_databases_get_connection_pool_request( database_cluster_uuid=database_cluster_uuid, pool_name=pool_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -97539,9 +102150,9 @@ def get_connection_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_connection_pool( @@ -97553,6 +102164,7 @@ def update_connection_pool( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Connection Pools (PostgreSQL). To update a connection pool for a PostgreSQL database cluster, send a PUT request to @@ -97607,11 +102219,12 @@ def update_connection_pool( self, database_cluster_uuid: str, pool_name: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Connection Pools (PostgreSQL). To update a connection pool for a PostgreSQL database cluster, send a PUT request to @@ -97622,7 +102235,7 @@ def update_connection_pool( :param pool_name: The name used to identify the connection pool. Required. :type pool_name: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -97651,9 +102264,10 @@ def update_connection_pool( self, database_cluster_uuid: str, pool_name: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update Connection Pools (PostgreSQL). To update a connection pool for a PostgreSQL database cluster, send a PUT request to @@ -97663,11 +102277,8 @@ def update_connection_pool( :type database_cluster_uuid: str :param pool_name: The name used to identify the connection pool. Required. :type pool_name: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -97675,6 +102286,21 @@ def update_connection_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "db": "str", # The database for use with the connection pool. Required. + "mode": "str", # The PGBouncer transaction mode for the connection pool. The + allowed values are session, transaction, and statement. Required. + "size": 0, # The desired size of the PGBouncer connection pool. The maximum + allowed size is determined by the size of the cluster's primary node. 25 backend + server connections are allowed for every 1GB of RAM. Three are reserved for + maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of + 22 backend server connections while one with 4 GB would allow for 97. Note that + these are shared across all connection pools in a cluster. Required. + "user": "str" # Optional. The name of the user for use with the connection + pool. When excluded, all sessions connect to the database as the inbound user. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -97687,10 +102313,14 @@ def update_connection_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97699,20 +102329,20 @@ def update_connection_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_connection_pool_request( + _request = build_databases_update_connection_pool_request( database_cluster_uuid=database_cluster_uuid, pool_name=pool_name, content_type=content_type, @@ -97721,18 +102351,21 @@ def update_connection_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -97765,14 +102398,15 @@ def update_connection_pool( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def delete_connection_pool( self, database_cluster_uuid: str, pool_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Connection Pool (PostgreSQL). To delete a specific connection pool for a PostgreSQL database cluster, send @@ -97804,10 +102438,14 @@ def delete_connection_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97816,26 +102454,29 @@ def delete_connection_pool( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_connection_pool_request( + _request = build_databases_delete_connection_pool_request( database_cluster_uuid=database_cluster_uuid, pool_name=pool_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -97868,12 +102509,13 @@ def delete_connection_pool( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_eviction_policy(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve the Eviction Policy for a Redis Cluster. To retrieve the configured eviction policy for an existing Redis cluster, send a GET request to @@ -97893,12 +102535,12 @@ def get_eviction_policy(self, database_cluster_uuid: str, **kwargs: Any) -> JSON # response body for status code(s): 200 response == { "eviction_policy": "str" # A string specifying the desired eviction policy - for the Redis cluster."n"n"n* ``noeviction``"" : Don't evict any data, returns - error when memory limit is reached."n* ``allkeys_lru:`` Evict any key, least - recently used (LRU) first."n* ``allkeys_random``"" : Evict keys in a random - order."n* ``volatile_lru``"" : Evict keys with expiration only, least recently - used (LRU) first."n* ``volatile_random``"" : Evict keys with expiration only in a - random order."n* ``volatile_ttl``"" : Evict keys with expiration only, shortest + for the Redis cluster. * ``noeviction``"" : Don't evict any data, returns error + when memory limit is reached. * ``allkeys_lru:`` Evict any key, least recently + used (LRU) first. * ``allkeys_random``"" : Evict keys in a random order. * + ``volatile_lru``"" : Evict keys with expiration only, least recently used (LRU) + first. * ``volatile_random``"" : Evict keys with expiration only in a random + order. * ``volatile_ttl``"" : Evict keys with expiration only, shortest time-to-live (TTL) first. Required. Known values are: "noeviction", "allkeys_lru", "allkeys_random", "volatile_lru", "volatile_random", and "volatile_ttl". @@ -97915,10 +102557,14 @@ def get_eviction_policy(self, database_cluster_uuid: str, **kwargs: Any) -> JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -97927,25 +102573,28 @@ def get_eviction_policy(self, database_cluster_uuid: str, **kwargs: Any) -> JSON _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_eviction_policy_request( + _request = build_databases_get_eviction_policy_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -97982,9 +102631,9 @@ def get_eviction_policy(self, database_cluster_uuid: str, **kwargs: Any) -> JSON deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_eviction_policy( @@ -97995,6 +102644,7 @@ def update_eviction_policy( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure the Eviction Policy for a Redis Cluster. To configure an eviction policy for an existing Redis cluster, send a PUT request to @@ -98017,12 +102667,12 @@ def update_eviction_policy( # JSON input template you can fill out and use as your body input. body = { "eviction_policy": "str" # A string specifying the desired eviction policy - for the Redis cluster."n"n"n* ``noeviction``"" : Don't evict any data, returns - error when memory limit is reached."n* ``allkeys_lru:`` Evict any key, least - recently used (LRU) first."n* ``allkeys_random``"" : Evict keys in a random - order."n* ``volatile_lru``"" : Evict keys with expiration only, least recently - used (LRU) first."n* ``volatile_random``"" : Evict keys with expiration only in a - random order."n* ``volatile_ttl``"" : Evict keys with expiration only, shortest + for the Redis cluster. * ``noeviction``"" : Don't evict any data, returns error + when memory limit is reached. * ``allkeys_lru:`` Evict any key, least recently + used (LRU) first. * ``allkeys_random``"" : Evict keys in a random order. * + ``volatile_lru``"" : Evict keys with expiration only, least recently used (LRU) + first. * ``volatile_random``"" : Evict keys with expiration only in a random + order. * ``volatile_ttl``"" : Evict keys with expiration only, shortest time-to-live (TTL) first. Required. Known values are: "noeviction", "allkeys_lru", "allkeys_random", "volatile_lru", "volatile_random", and "volatile_ttl". @@ -98045,11 +102695,12 @@ def update_eviction_policy( def update_eviction_policy( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure the Eviction Policy for a Redis Cluster. To configure an eviction policy for an existing Redis cluster, send a PUT request to @@ -98058,7 +102709,7 @@ def update_eviction_policy( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -98084,8 +102735,9 @@ def update_eviction_policy( @distributed_trace def update_eviction_policy( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Configure the Eviction Policy for a Redis Cluster. To configure an eviction policy for an existing Redis cluster, send a PUT request to @@ -98093,11 +102745,8 @@ def update_eviction_policy( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -98105,6 +102754,20 @@ def update_eviction_policy( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "eviction_policy": "str" # A string specifying the desired eviction policy + for the Redis cluster. * ``noeviction``"" : Don't evict any data, returns error + when memory limit is reached. * ``allkeys_lru:`` Evict any key, least recently + used (LRU) first. * ``allkeys_random``"" : Evict keys in a random order. * + ``volatile_lru``"" : Evict keys with expiration only, least recently used (LRU) + first. * ``volatile_random``"" : Evict keys with expiration only in a random + order. * ``volatile_ttl``"" : Evict keys with expiration only, shortest + time-to-live (TTL) first. Required. Known values are: "noeviction", + "allkeys_lru", "allkeys_random", "volatile_lru", "volatile_random", and + "volatile_ttl". + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -98117,10 +102780,14 @@ def update_eviction_policy( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98129,20 +102796,20 @@ def update_eviction_policy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_eviction_policy_request( + _request = build_databases_update_eviction_policy_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -98150,18 +102817,21 @@ def update_eviction_policy( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -98194,12 +102864,13 @@ def update_eviction_policy( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_sql_mode(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve the SQL Modes for a MySQL Cluster. To retrieve the configured SQL modes for an existing MySQL cluster, send a GET request to @@ -98233,10 +102904,14 @@ def get_sql_mode(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98245,25 +102920,28 @@ def get_sql_mode(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_sql_mode_request( + _request = build_databases_get_sql_mode_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -98300,9 +102978,9 @@ def get_sql_mode(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_sql_mode( @@ -98313,6 +102991,7 @@ def update_sql_mode( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update SQL Mode for a Cluster. To configure the SQL modes for an existing MySQL cluster, send a PUT request to @@ -98358,11 +103037,12 @@ def update_sql_mode( def update_sql_mode( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update SQL Mode for a Cluster. To configure the SQL modes for an existing MySQL cluster, send a PUT request to @@ -98374,7 +103054,7 @@ def update_sql_mode( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -98400,8 +103080,9 @@ def update_sql_mode( @distributed_trace def update_sql_mode( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Update SQL Mode for a Cluster. To configure the SQL modes for an existing MySQL cluster, send a PUT request to @@ -98412,11 +103093,8 @@ def update_sql_mode( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -98424,6 +103102,12 @@ def update_sql_mode( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "sql_mode": "str" # A string specifying the configured SQL modes for the + MySQL cluster. Required. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -98436,10 +103120,14 @@ def update_sql_mode( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98448,20 +103136,20 @@ def update_sql_mode( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_sql_mode_request( + _request = build_databases_update_sql_mode_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -98469,18 +103157,21 @@ def update_sql_mode( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -98513,9 +103204,9 @@ def update_sql_mode( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def update_major_version( @@ -98526,10 +103217,11 @@ def update_major_version( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade Major Version for a Database. To upgrade the major version of a database, send a PUT request to - ``/v2/databases/$DATABASE_ID/upgrade``\ , specifying the target version. + ``/v2/databases/$DATABASE_ID/upgrade``\\ , specifying the target version. A successful request will receive a 204 No Content status code with no body in response. :param database_cluster_uuid: A unique identifier for a database cluster. Required. @@ -98569,21 +103261,22 @@ def update_major_version( def update_major_version( self, database_cluster_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade Major Version for a Database. To upgrade the major version of a database, send a PUT request to - ``/v2/databases/$DATABASE_ID/upgrade``\ , specifying the target version. + ``/v2/databases/$DATABASE_ID/upgrade``\\ , specifying the target version. A successful request will receive a 204 No Content status code with no body in response. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -98609,21 +103302,19 @@ def update_major_version( @distributed_trace def update_major_version( - self, database_cluster_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, database_cluster_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade Major Version for a Database. To upgrade the major version of a database, send a PUT request to - ``/v2/databases/$DATABASE_ID/upgrade``\ , specifying the target version. + ``/v2/databases/$DATABASE_ID/upgrade``\\ , specifying the target version. A successful request will receive a 204 No Content status code with no body in response. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -98631,6 +103322,12 @@ def update_major_version( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "version": "str" # Optional. A string representing the version of the + database engine in use for the cluster. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -98643,10 +103340,14 @@ def update_major_version( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98655,20 +103356,20 @@ def update_major_version( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_databases_update_major_version_request( + _request = build_databases_update_major_version_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -98676,18 +103377,21 @@ def update_major_version( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -98720,12 +103424,13 @@ def update_major_version( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_kafka_topics(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Topics for a Kafka Cluster. To list all of a Kafka cluster's topics, send a GET request to @@ -98768,10 +103473,14 @@ def list_kafka_topics(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -98780,25 +103489,28 @@ def list_kafka_topics(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_list_kafka_topics_request( + _request = build_databases_list_kafka_topics_request( database_cluster_uuid=database_cluster_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -98835,9 +103547,9 @@ def list_kafka_topics(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_kafka_topic( @@ -98848,6 +103560,7 @@ def create_kafka_topic( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create Topic for a Kafka Cluster. To create a topic attached to a Kafka cluster, send a POST request to @@ -99105,11 +103818,12 @@ def create_kafka_topic( def create_kafka_topic( self, database_cluster_uuid: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create Topic for a Kafka Cluster. To create a topic attached to a Kafka cluster, send a POST request to @@ -99120,7 +103834,7 @@ def create_kafka_topic( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -99272,9 +103986,10 @@ def create_kafka_topic( def create_kafka_topic( self, database_cluster_uuid: str, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create Topic for a Kafka Cluster. To create a topic attached to a Kafka cluster, send a POST request to @@ -99284,11 +103999,8 @@ def create_kafka_topic( :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -99296,6 +104008,101 @@ def create_kafka_topic( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "config": { + "cleanup_policy": "delete", # Optional. Default value is "delete". + The cleanup_policy sets the retention policy to use on log segments. 'delete' + will discard old segments when retention time/size limits are reached. + 'compact' will enable log compaction, resulting in retention of the latest + value for each key. Known values are: "delete", "compact", and + "compact_delete". + "compression_type": "producer", # Optional. Default value is + "producer". The compression_type specifies the compression type of the topic. + Known values are: "producer", "gzip", "snappy", "Iz4", "zstd", and + "uncompressed". + "delete_retention_ms": 86400000, # Optional. Default value is + 86400000. The delete_retention_ms specifies how long (in ms) to retain delete + tombstone markers for topics. + "file_delete_delay_ms": 60000, # Optional. Default value is 60000. + The file_delete_delay_ms specifies the time (in ms) to wait before deleting a + file from the filesystem. + "flush_messages": 9223372036854776000, # Optional. Default value is + 9223372036854776000. The flush_messages specifies the number of messages to + accumulate on a log partition before messages are flushed to disk. + "flush_ms": 9223372036854776000, # Optional. Default value is + 9223372036854776000. The flush_ms specifies the maximum time (in ms) that a + message is kept in memory before being flushed to disk. + "index_interval_bytes": 4096, # Optional. Default value is 4096. The + index_interval_bytes specifies the number of bytes between entries being + added into te offset index. + "max_compaction_lag_ms": 9223372036854776000, # Optional. Default + value is 9223372036854776000. The max_compaction_lag_ms specifies the maximum + amount of time (in ms) that a message will remain uncompacted. This is only + applicable if the logs are have compaction enabled. + "max_message_bytes": 1048588, # Optional. Default value is 1048588. + The max_messages_bytes specifies the largest record batch size (in bytes) + that can be sent to the server. This is calculated after compression if + compression is enabled. + "message_down_conversion_enable": True, # Optional. Default value is + True. The message_down_conversion_enable specifies whether down-conversion of + message formats is enabled to satisfy consumer requests. When 'false', the + broker will not perform conversion for consumers expecting older message + formats. The broker will respond with an ``UNSUPPORTED_VERSION`` error for + consume requests from these older clients. + "message_format_version": "3.0-IV1", # Optional. Default value is + "3.0-IV1". The message_format_version specifies the message format version + used by the broker to append messages to the logs. The value of this setting + is assumed to be 3.0-IV1 if the broker protocol version is 3.0 or higher. By + setting a particular message format version, all existing messages on disk + must be smaller or equal to the specified version. Known values are: "0.8.0", + "0.8.1", "0.8.2", "0.9.0", "0.10.0-IV0", "0.10.0-IV1", "0.10.1-IV0", + "0.10.1-IV1", "0.10.1-IV2", "0.10.2-IV0", "0.11.0-IV0", "0.11.0-IV1", + "0.11.0-IV2", "1.0-IV0", "1.1-IV0", "2.0-IV0", "2.0-IV1", "2.1-IV0", + "2.1-IV1", "2.1-IV2", "2.2-IV0", "2.2-IV1", "2.3-IV0", "2.3-IV1", "2.4-IV0", + "2.4-IV1", "2.5-IV0", "2.6-IV0", "2.7-IV0", "2.7-IV1", "2.7-IV2", "2.8-IV0", + "2.8-IV1", "3.0-IV0", "3.0-IV1", "3.1-IV0", "3.2-IV0", "3.3-IV0", "3.3-IV1", + "3.3-IV2", and "3.3-IV3". + "message_timestamp_type": "create_time", # Optional. Default value + is "create_time". The message_timestamp_type specifies whether to use the + message create time or log append time as the timestamp on a message. Known + values are: "create_time" and "log_append_time". + "min_cleanable_dirty_ratio": 0.5, # Optional. Default value is 0.5. + The min_cleanable_dirty_ratio specifies the frequency of log compaction (if + enabled) in relation to duplicates present in the logs. For example, at 0.5, + at most 50% of the log could be duplicates before compaction would begin. + "min_compaction_lag_ms": 0, # Optional. Default value is 0. The + min_compaction_lag_ms specifies the minimum time (in ms) that a message will + remain uncompacted in the log. Only relevant if log compaction is enabled. + "min_insync_replicas": 1, # Optional. Default value is 1. The + min_insync_replicas specifies the number of replicas that must ACK a write + for the write to be considered successful. + "preallocate": False, # Optional. Default value is False. The + preallocate specifies whether a file should be preallocated on disk when + creating a new log segment. + "retention_bytes": -1, # Optional. Default value is -1. The + retention_bytes specifies the maximum size of the log (in bytes) before + deleting messages. -1 indicates that there is no limit. + "retention_ms": 604800000, # Optional. Default value is 604800000. + The retention_ms specifies the maximum amount of time (in ms) to keep a + message before deleting it. + "segment_bytes": 209715200, # Optional. Default value is 209715200. + The segment_bytes specifies the maximum size of a single log file (in bytes). + "segment_jitter_ms": 0, # Optional. Default value is 0. The + segment_jitter_ms specifies the maximum random jitter subtracted from the + scheduled segment roll time to avoid thundering herds of segment rolling. + "segment_ms": 604800000 # Optional. Default value is 604800000. The + segment_ms specifies the period of time after which the log will be forced to + roll if the segment file isn't full. This ensures that retention can delete + or compact old data. + }, + "name": "str", # Optional. The name of the Kafka topic. + "partition_count": 0, # Optional. The number of partitions available for the + topic. On update, this value can only be increased. + "replication_factor": 0 # Optional. The number of nodes to replicate data + across the cluster. + } + # response body for status code(s): 201 response == { "topic": { @@ -99432,10 +104239,14 @@ def create_kafka_topic( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -99444,15 +104255,15 @@ def create_kafka_topic( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -99460,7 +104271,7 @@ def create_kafka_topic( else: _json = None - request = build_databases_create_kafka_topic_request( + _request = build_databases_create_kafka_topic_request( database_cluster_uuid=database_cluster_uuid, content_type=content_type, json=_json, @@ -99468,18 +104279,21 @@ def create_kafka_topic( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -99516,14 +104330,15 @@ def create_kafka_topic( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_kafka_topic( self, database_cluster_uuid: str, topic_name: str, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Get Topic for a Kafka Cluster. To retrieve a given topic by name from the set of a Kafka cluster's topics, @@ -99678,10 +104493,14 @@ def get_kafka_topic( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -99690,26 +104509,29 @@ def get_kafka_topic( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_kafka_topic_request( + _request = build_databases_get_kafka_topic_request( database_cluster_uuid=database_cluster_uuid, topic_name=topic_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -99746,9 +104568,9 @@ def get_kafka_topic( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_kafka_topic( @@ -99760,6 +104582,7 @@ def update_kafka_topic( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Topic for a Kafka Cluster. To update a topic attached to a Kafka cluster, send a PUT request to @@ -100019,11 +104842,12 @@ def update_kafka_topic( self, database_cluster_uuid: str, topic_name: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Topic for a Kafka Cluster. To update a topic attached to a Kafka cluster, send a PUT request to @@ -100036,7 +104860,7 @@ def update_kafka_topic( :param topic_name: The name used to identify the Kafka topic. Required. :type topic_name: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -100189,9 +105013,10 @@ def update_kafka_topic( self, database_cluster_uuid: str, topic_name: str, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Topic for a Kafka Cluster. To update a topic attached to a Kafka cluster, send a PUT request to @@ -100203,11 +105028,8 @@ def update_kafka_topic( :type database_cluster_uuid: str :param topic_name: The name used to identify the Kafka topic. Required. :type topic_name: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -100215,6 +105037,100 @@ def update_kafka_topic( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "config": { + "cleanup_policy": "delete", # Optional. Default value is "delete". + The cleanup_policy sets the retention policy to use on log segments. 'delete' + will discard old segments when retention time/size limits are reached. + 'compact' will enable log compaction, resulting in retention of the latest + value for each key. Known values are: "delete", "compact", and + "compact_delete". + "compression_type": "producer", # Optional. Default value is + "producer". The compression_type specifies the compression type of the topic. + Known values are: "producer", "gzip", "snappy", "Iz4", "zstd", and + "uncompressed". + "delete_retention_ms": 86400000, # Optional. Default value is + 86400000. The delete_retention_ms specifies how long (in ms) to retain delete + tombstone markers for topics. + "file_delete_delay_ms": 60000, # Optional. Default value is 60000. + The file_delete_delay_ms specifies the time (in ms) to wait before deleting a + file from the filesystem. + "flush_messages": 9223372036854776000, # Optional. Default value is + 9223372036854776000. The flush_messages specifies the number of messages to + accumulate on a log partition before messages are flushed to disk. + "flush_ms": 9223372036854776000, # Optional. Default value is + 9223372036854776000. The flush_ms specifies the maximum time (in ms) that a + message is kept in memory before being flushed to disk. + "index_interval_bytes": 4096, # Optional. Default value is 4096. The + index_interval_bytes specifies the number of bytes between entries being + added into te offset index. + "max_compaction_lag_ms": 9223372036854776000, # Optional. Default + value is 9223372036854776000. The max_compaction_lag_ms specifies the maximum + amount of time (in ms) that a message will remain uncompacted. This is only + applicable if the logs are have compaction enabled. + "max_message_bytes": 1048588, # Optional. Default value is 1048588. + The max_messages_bytes specifies the largest record batch size (in bytes) + that can be sent to the server. This is calculated after compression if + compression is enabled. + "message_down_conversion_enable": True, # Optional. Default value is + True. The message_down_conversion_enable specifies whether down-conversion of + message formats is enabled to satisfy consumer requests. When 'false', the + broker will not perform conversion for consumers expecting older message + formats. The broker will respond with an ``UNSUPPORTED_VERSION`` error for + consume requests from these older clients. + "message_format_version": "3.0-IV1", # Optional. Default value is + "3.0-IV1". The message_format_version specifies the message format version + used by the broker to append messages to the logs. The value of this setting + is assumed to be 3.0-IV1 if the broker protocol version is 3.0 or higher. By + setting a particular message format version, all existing messages on disk + must be smaller or equal to the specified version. Known values are: "0.8.0", + "0.8.1", "0.8.2", "0.9.0", "0.10.0-IV0", "0.10.0-IV1", "0.10.1-IV0", + "0.10.1-IV1", "0.10.1-IV2", "0.10.2-IV0", "0.11.0-IV0", "0.11.0-IV1", + "0.11.0-IV2", "1.0-IV0", "1.1-IV0", "2.0-IV0", "2.0-IV1", "2.1-IV0", + "2.1-IV1", "2.1-IV2", "2.2-IV0", "2.2-IV1", "2.3-IV0", "2.3-IV1", "2.4-IV0", + "2.4-IV1", "2.5-IV0", "2.6-IV0", "2.7-IV0", "2.7-IV1", "2.7-IV2", "2.8-IV0", + "2.8-IV1", "3.0-IV0", "3.0-IV1", "3.1-IV0", "3.2-IV0", "3.3-IV0", "3.3-IV1", + "3.3-IV2", and "3.3-IV3". + "message_timestamp_type": "create_time", # Optional. Default value + is "create_time". The message_timestamp_type specifies whether to use the + message create time or log append time as the timestamp on a message. Known + values are: "create_time" and "log_append_time". + "min_cleanable_dirty_ratio": 0.5, # Optional. Default value is 0.5. + The min_cleanable_dirty_ratio specifies the frequency of log compaction (if + enabled) in relation to duplicates present in the logs. For example, at 0.5, + at most 50% of the log could be duplicates before compaction would begin. + "min_compaction_lag_ms": 0, # Optional. Default value is 0. The + min_compaction_lag_ms specifies the minimum time (in ms) that a message will + remain uncompacted in the log. Only relevant if log compaction is enabled. + "min_insync_replicas": 1, # Optional. Default value is 1. The + min_insync_replicas specifies the number of replicas that must ACK a write + for the write to be considered successful. + "preallocate": False, # Optional. Default value is False. The + preallocate specifies whether a file should be preallocated on disk when + creating a new log segment. + "retention_bytes": -1, # Optional. Default value is -1. The + retention_bytes specifies the maximum size of the log (in bytes) before + deleting messages. -1 indicates that there is no limit. + "retention_ms": 604800000, # Optional. Default value is 604800000. + The retention_ms specifies the maximum amount of time (in ms) to keep a + message before deleting it. + "segment_bytes": 209715200, # Optional. Default value is 209715200. + The segment_bytes specifies the maximum size of a single log file (in bytes). + "segment_jitter_ms": 0, # Optional. Default value is 0. The + segment_jitter_ms specifies the maximum random jitter subtracted from the + scheduled segment roll time to avoid thundering herds of segment rolling. + "segment_ms": 604800000 # Optional. Default value is 604800000. The + segment_ms specifies the period of time after which the log will be forced to + roll if the segment file isn't full. This ensures that retention can delete + or compact old data. + }, + "partition_count": 0, # Optional. The number of partitions available for the + topic. On update, this value can only be increased. + "replication_factor": 0 # Optional. The number of nodes to replicate data + across the cluster. + } + # response body for status code(s): 200 response == { "topic": { @@ -100351,10 +105267,14 @@ def update_kafka_topic( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -100363,15 +105283,15 @@ def update_kafka_topic( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -100379,7 +105299,7 @@ def update_kafka_topic( else: _json = None - request = build_databases_update_kafka_topic_request( + _request = build_databases_update_kafka_topic_request( database_cluster_uuid=database_cluster_uuid, topic_name=topic_name, content_type=content_type, @@ -100388,18 +105308,21 @@ def update_kafka_topic( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -100436,14 +105359,15 @@ def update_kafka_topic( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_kafka_topic( self, database_cluster_uuid: str, topic_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Topic for a Kafka Cluster. To delete a single topic within a Kafka cluster, send a DELETE request @@ -100475,10 +105399,14 @@ def delete_kafka_topic( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -100487,26 +105415,29 @@ def delete_kafka_topic( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_databases_delete_kafka_topic_request( + _request = build_databases_delete_kafka_topic_request( database_cluster_uuid=database_cluster_uuid, topic_name=topic_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -100539,12 +105470,13 @@ def delete_kafka_topic( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_cluster_metrics_credentials(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve Database Clusters' Metrics Endpoint Credentials. To show the credentials for all database clusters' metrics endpoints, send a GET request to @@ -100581,10 +105513,14 @@ def get_cluster_metrics_credentials(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -100593,24 +105529,27 @@ def get_cluster_metrics_credentials(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_databases_get_cluster_metrics_credentials_request( + _request = build_databases_get_cluster_metrics_credentials_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -100647,9 +105586,9 @@ def get_cluster_metrics_credentials(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-statements @@ -100691,7 +105630,7 @@ def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-s @overload def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-statements self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, @@ -100703,7 +105642,7 @@ def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-s status code with no body in response. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -100714,7 +105653,7 @@ def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-s @distributed_trace def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """Update Database Clusters' Metrics Endpoint Credentials. @@ -100722,19 +105661,33 @@ def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-s ``/v2/databases/metrics/credentials``. A successful request will receive a 204 No Content status code with no body in response. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "credentials": { + "basic_auth_password": "str", # Optional. basic authentication + password for metrics HTTP endpoint. + "basic_auth_username": "str" # Optional. basic authentication + username for metrics HTTP endpoint. + } + } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -100743,15 +105696,15 @@ def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-s _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -100759,25 +105712,28 @@ def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-s else: _json = None - request = build_databases_update_cluster_metrics_credentials_request( + _request = build_databases_update_cluster_metrics_credentials_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -100792,7 +105748,7 @@ def update_cluster_metrics_credentials( # pylint: disable=inconsistent-return-s ) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) # type: ignore class DomainsOperations: @@ -100816,6 +105772,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Domains. To retrieve a list of all of the domains in your account, send a GET request to @@ -100854,18 +105811,22 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: accessible as an individual record resource. } ], - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. + }, + "links": { + "pages": {} } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -100874,26 +105835,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_domains_list_request( + _request = build_domains_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -100913,9 +105877,9 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( @@ -100925,6 +105889,7 @@ def create( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain. To create a new domain, send a POST request to ``/v2/domains``. Set the "name" @@ -100987,11 +105952,12 @@ def create( @overload def create( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain. To create a new domain, send a POST request to ``/v2/domains``. Set the "name" @@ -101000,7 +105966,7 @@ def create( to the apex domain. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -101034,7 +106000,10 @@ def create( """ @distributed_trace - def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: + def create( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain. To create a new domain, send a POST request to ``/v2/domains``. Set the "name" @@ -101042,11 +106011,8 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: "ip_address" attribute, and an A record will be automatically created pointing to the apex domain. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -101054,6 +106020,24 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "ip_address": "str", # Optional. This optional attribute may contain an IP + address. When provided, an A record will be automatically created pointing to the + apex domain. + "name": "str", # Optional. The name of the domain itself. This should follow + the standard domain format of domain.TLD. For instance, ``example.com`` is a + valid domain name. + "ttl": 0, # Optional. This value is the time to live for the records on this + domain, in seconds. This defines the time frame that clients can cache queried + information before a refresh should be requested. + "zone_file": "str" # Optional. This attribute contains the complete contents + of the zone file for the selected domain. Individual domain record resources + should be used to get more granular control over records. However, this attribute + can also be used to get information about the SOA record, which is created + automatically and is not accessible as an individual record resource. + } + # response body for status code(s): 201 response == { "domain": { @@ -101075,10 +106059,14 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101087,15 +106075,15 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -101103,25 +106091,28 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: else: _json = None - request = build_domains_create_request( + _request = build_domains_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -101141,12 +106132,13 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, domain_name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Domain. To get details about a specific domain, send a GET request to ``/v2/domains/$DOMAIN_NAME``. @@ -101192,10 +106184,14 @@ def get(self, domain_name: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101204,25 +106200,28 @@ def get(self, domain_name: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_domains_get_request( + _request = build_domains_get_request( domain_name=domain_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -101259,12 +106258,13 @@ def get(self, domain_name: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, domain_name: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Domain. To delete a domain, send a DELETE request to ``/v2/domains/$DOMAIN_NAME``. @@ -101290,10 +106290,14 @@ def delete(self, domain_name: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101302,25 +106306,28 @@ def delete(self, domain_name: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_domains_delete_request( + _request = build_domains_delete_request( domain_name=domain_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -101353,9 +106360,9 @@ def delete(self, domain_name: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_records( @@ -101368,6 +106375,7 @@ def list_records( page: int = 1, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Domain Records. To get a listing of all records configured for a domain, send a GET request to @@ -101375,7 +106383,7 @@ def list_records( The list of records returned can be filtered by using the ``name`` and ``type`` query parameters. For example, to only include A records for a domain, send a GET request to ``/v2/domains/$DOMAIN_NAME/records?type=A``. ``name`` must be a fully qualified record name. - For example, to only include records matching ``sub.example.com``\ , send a GET request to + For example, to only include records matching ``sub.example.com``\\ , send a GET request to ``/v2/domains/$DOMAIN_NAME/records?name=sub.example.com``. Both name and type may be used together. @@ -101401,8 +106409,13 @@ def list_records( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "domain_records": [ { + "type": "str", # The type of the DNS record. For example: A, + CNAME, TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would @@ -101422,16 +106435,11 @@ def list_records( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, - CNAME, TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -101446,10 +106454,14 @@ def list_records( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101458,9 +106470,9 @@ def list_records( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_domains_list_records_request( + _request = build_domains_list_records_request( domain_name=domain_name, name=name, type=type, @@ -101469,18 +106481,21 @@ def list_records( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -101517,9 +106532,9 @@ def list_records( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_record( @@ -101530,6 +106545,7 @@ def create_record( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain Record. To create a new record to a domain, send a POST request to @@ -101561,6 +106577,8 @@ def create_record( # response body for status code(s): 201 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -101577,8 +106595,6 @@ def create_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -101599,11 +106615,12 @@ def create_record( def create_record( self, domain_name: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain Record. To create a new record to a domain, send a POST request to @@ -101618,7 +106635,7 @@ def create_record( :param domain_name: The name of the domain itself. Required. :type domain_name: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -101632,6 +106649,8 @@ def create_record( # response body for status code(s): 201 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -101648,8 +106667,6 @@ def create_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -101668,8 +106685,12 @@ def create_record( @distributed_trace def create_record( - self, domain_name: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + domain_name: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Domain Record. To create a new record to a domain, send a POST request to @@ -101683,11 +106704,8 @@ def create_record( :param domain_name: The name of the domain itself. Required. :type domain_name: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -101695,9 +106713,14 @@ def create_record( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -101714,8 +106737,6 @@ def create_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -101731,10 +106752,14 @@ def create_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101743,15 +106768,15 @@ def create_record( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -101759,7 +106784,7 @@ def create_record( else: _json = None - request = build_domains_create_record_request( + _request = build_domains_create_record_request( domain_name=domain_name, content_type=content_type, json=_json, @@ -101767,18 +106792,21 @@ def create_record( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -101815,14 +106843,15 @@ def create_record( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_record( self, domain_name: str, domain_record_id: int, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Domain Record. To retrieve a specific domain record, send a GET request to @@ -101842,6 +106871,8 @@ def get_record( # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -101858,8 +106889,6 @@ def get_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -101875,10 +106904,14 @@ def get_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -101887,26 +106920,29 @@ def get_record( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_domains_get_record_request( + _request = build_domains_get_record_request( domain_name=domain_name, domain_record_id=domain_record_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -101943,9 +106979,9 @@ def get_record( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def patch_record( @@ -101957,6 +106993,7 @@ def patch_record( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PATCH request to @@ -101984,6 +107021,8 @@ def patch_record( # JSON input template you can fill out and use as your body input. body = { + "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... + Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the @@ -102000,14 +107039,14 @@ def patch_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... - Required. "weight": 0 # Optional. The weight for SRV records. } # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -102024,8 +107063,6 @@ def patch_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -102047,11 +107084,12 @@ def patch_record( self, domain_name: str, domain_record_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PATCH request to @@ -102066,7 +107104,7 @@ def patch_record( :param domain_record_id: The unique identifier of the domain record. Required. :type domain_record_id: int :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -102080,6 +107118,8 @@ def patch_record( # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -102096,8 +107136,6 @@ def patch_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -102119,9 +107157,10 @@ def patch_record( self, domain_name: str, domain_record_id: int, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PATCH request to @@ -102135,11 +107174,8 @@ def patch_record( :type domain_name: str :param domain_record_id: The unique identifier of the domain record. Required. :type domain_record_id: int - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -102147,9 +107183,34 @@ def patch_record( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... + Required. + "data": "str", # Optional. Variable data depending on record type. For + example, the "data" value for an A record would be the IPv4 address to which the + domain will be mapped. For a CAA record, it would contain the domain name of the + CA being granted permission to issue certificates. + "flags": 0, # Optional. An unsigned integer between 0-255 used for CAA + records. + "id": 0, # Optional. A unique identifier for each domain record. + "name": "str", # Optional. The host name, alias, or service being defined by + the record. + "port": 0, # Optional. The port for SRV records. + "priority": 0, # Optional. The priority for SRV and MX records. + "tag": "str", # Optional. The parameter tag for CAA records. Valid values + are "issue", "issuewild", or "iodef". + "ttl": 0, # Optional. This value is the time to live for the record, in + seconds. This defines the time frame that clients can cache queried information + before a refresh should be requested. + "weight": 0 # Optional. The weight for SRV records. + } + # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -102166,8 +107227,6 @@ def patch_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -102183,10 +107242,14 @@ def patch_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -102195,15 +107258,15 @@ def patch_record( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -102211,7 +107274,7 @@ def patch_record( else: _json = None - request = build_domains_patch_record_request( + _request = build_domains_patch_record_request( domain_name=domain_name, domain_record_id=domain_record_id, content_type=content_type, @@ -102220,18 +107283,21 @@ def patch_record( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -102268,9 +107334,9 @@ def patch_record( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_record( @@ -102282,6 +107348,7 @@ def update_record( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PUT request to @@ -102309,6 +107376,8 @@ def update_record( # JSON input template you can fill out and use as your body input. body = { + "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... + Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the @@ -102325,14 +107394,14 @@ def update_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... - Required. "weight": 0 # Optional. The weight for SRV records. } # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -102349,8 +107418,6 @@ def update_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -102372,11 +107439,12 @@ def update_record( self, domain_name: str, domain_record_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PUT request to @@ -102391,7 +107459,7 @@ def update_record( :param domain_record_id: The unique identifier of the domain record. Required. :type domain_record_id: int :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -102405,6 +107473,8 @@ def update_record( # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -102421,8 +107491,6 @@ def update_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -102444,9 +107512,10 @@ def update_record( self, domain_name: str, domain_record_id: int, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Domain Record. To update an existing record, send a PUT request to @@ -102460,11 +107529,8 @@ def update_record( :type domain_name: str :param domain_record_id: The unique identifier of the domain record. Required. :type domain_record_id: int - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -102472,9 +107538,34 @@ def update_record( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "type": "str", # The type of the DNS record. For example: A, CNAME, TXT, ... + Required. + "data": "str", # Optional. Variable data depending on record type. For + example, the "data" value for an A record would be the IPv4 address to which the + domain will be mapped. For a CAA record, it would contain the domain name of the + CA being granted permission to issue certificates. + "flags": 0, # Optional. An unsigned integer between 0-255 used for CAA + records. + "id": 0, # Optional. A unique identifier for each domain record. + "name": "str", # Optional. The host name, alias, or service being defined by + the record. + "port": 0, # Optional. The port for SRV records. + "priority": 0, # Optional. The priority for SRV and MX records. + "tag": "str", # Optional. The parameter tag for CAA records. Valid values + are "issue", "issuewild", or "iodef". + "ttl": 0, # Optional. This value is the time to live for the record, in + seconds. This defines the time frame that clients can cache queried information + before a refresh should be requested. + "weight": 0 # Optional. The weight for SRV records. + } + # response body for status code(s): 200 response == { "domain_record": { + "type": "str", # The type of the DNS record. For example: A, CNAME, + TXT, ... Required. "data": "str", # Optional. Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the @@ -102491,8 +107582,6 @@ def update_record( "ttl": 0, # Optional. This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested. - "type": "str", # The type of the DNS record. For example: A, CNAME, - TXT, ... Required. "weight": 0 # Optional. The weight for SRV records. } } @@ -102508,10 +107597,14 @@ def update_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -102520,15 +107613,15 @@ def update_record( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -102536,7 +107629,7 @@ def update_record( else: _json = None - request = build_domains_update_record_request( + _request = build_domains_update_record_request( domain_name=domain_name, domain_record_id=domain_record_id, content_type=content_type, @@ -102545,18 +107638,21 @@ def update_record( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -102593,14 +107689,15 @@ def update_record( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_record( self, domain_name: str, domain_record_id: int, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Domain Record. To delete a record for a domain, send a DELETE request to @@ -102632,10 +107729,14 @@ def delete_record( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -102644,26 +107745,29 @@ def delete_record( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_domains_delete_record_request( + _request = build_domains_delete_record_request( domain_name=domain_name, domain_record_id=domain_record_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -102696,9 +107800,9 @@ def delete_record( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class DropletsOperations: @@ -102730,6 +107834,7 @@ def list( name: Optional[str] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Droplets. To list all Droplets in your account, send a GET request to ``/v2/droplets``. @@ -102765,6 +107870,9 @@ def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "droplets": [ { "backup_ids": [ @@ -102800,7 +107908,7 @@ def list( "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string - containing information about errors that may occur when importing"n a + containing information about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. @@ -102825,7 +107933,7 @@ def list( public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string - indicating the state of a custom image. This may be ``NEW``"" ,"n + indicating the state of a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". @@ -102843,16 +107951,6 @@ def list( (e.g. DOKS worker nodes). Known values are: "base", "snapshot", "backup", "custom", and "admin". }, - "kernel": { - "id": 0, # Optional. A unique number used to - identify and reference a specific kernel. - "name": "str", # Optional. The display name of the - kernel. This is shown in the web UI and is generally a descriptive - title for the kernel in question. - "version": "str" # Optional. A standard kernel - version string representing the version, patch, and release - information. - }, "locked": bool, # A boolean value indicating whether the Droplet has been locked, preventing actions by users. Required. "memory": 0, # Memory of the Droplet in megabytes. Required. @@ -102862,9 +107960,9 @@ def list( "v4": [ { "gateway": "str", # Optional. The - gateway of the specified IPv4 network interface."n"nFor - private interfaces, a gateway is not provided. This is - denoted by"nreturning ``nil`` as its value. + gateway of the specified IPv4 network interface. For private + interfaces, a gateway is not provided. This is denoted by + returning ``nil`` as its value. "ip_address": "str", # Optional. The IP address of the IPv4 network interface. "netmask": "str", # Optional. The @@ -102883,7 +107981,7 @@ def list( "netmask": 0, # Optional. The netmask of the IPv6 network interface. "type": "str" # Optional. The type - of the IPv6 network interface."n"n**Note**"" : IPv6 private + of the IPv6 network interface. **Note**"" : IPv6 private networking is not currently supported. "public" } ] @@ -102962,22 +108060,33 @@ class of Droplets created from this size. For example: Basic, General "str" # A flat array including the unique identifier for each Block Storage volume attached to the Droplet. Required. ], + "kernel": { + "id": 0, # Optional. A unique number used to + identify and reference a specific kernel. + "name": "str", # Optional. The display name of the + kernel. This is shown in the web UI and is generally a descriptive + title for the kernel in question. + "version": "str" # Optional. A standard kernel + version string representing the version, patch, and release + information. + }, "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Droplet is assigned. } ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -102986,9 +108095,9 @@ class of Droplets created from this size. For example: Basic, General _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_request( + _request = build_droplets_list_request( per_page=per_page, page=page, tag_name=tag_name, @@ -102996,18 +108105,21 @@ class of Droplets created from this size. For example: Basic, General headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -103027,9 +108139,9 @@ class of Droplets created from this size. For example: Basic, General deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( @@ -103087,7 +108199,7 @@ def create( @overload def create( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, @@ -103122,7 +108234,7 @@ def create( check the status of each individual Droplet create event. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -103132,7 +108244,9 @@ def create( """ @distributed_trace - def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: + def create( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: """Create a New Droplet. To create a new Droplet, send a POST request to ``/v2/droplets`` setting the @@ -103162,19 +108276,26 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: of ``actions`` returned as part of the response's ``links`` object can be used to check the status of each individual Droplet create event. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = {} """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103183,15 +108304,15 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -103199,25 +108320,28 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: else: _json = None - request = build_droplets_create_request( + _request = build_droplets_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -103237,12 +108361,13 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def destroy_by_tag(self, *, tag_name: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Deleting Droplets by Tag. To delete **all** Droplets assigned to a specific tag, include the ``tag_name`` @@ -103273,10 +108398,14 @@ def destroy_by_tag(self, *, tag_name: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103285,25 +108414,28 @@ def destroy_by_tag(self, *, tag_name: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_droplets_destroy_by_tag_request( + _request = build_droplets_destroy_by_tag_request( tag_name=tag_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -103339,12 +108471,13 @@ def destroy_by_tag(self, *, tag_name: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get(self, droplet_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Droplet. To show information about an individual Droplet, send a GET request to @@ -103393,7 +108526,7 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing - information about errors that may occur when importing"n a custom image. + information about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB @@ -103417,7 +108550,7 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the - state of a custom image. This may be ``NEW``"" ,"n ``available``"" , + state of a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -103434,15 +108567,6 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: worker nodes). Known values are: "base", "snapshot", "backup", "custom", and "admin". }, - "kernel": { - "id": 0, # Optional. A unique number used to identify and - reference a specific kernel. - "name": "str", # Optional. The display name of the kernel. - This is shown in the web UI and is generally a descriptive title for the - kernel in question. - "version": "str" # Optional. A standard kernel version - string representing the version, patch, and release information. - }, "locked": bool, # A boolean value indicating whether the Droplet has been locked, preventing actions by users. Required. "memory": 0, # Memory of the Droplet in megabytes. Required. @@ -103452,9 +108576,9 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: "v4": [ { "gateway": "str", # Optional. The gateway of - the specified IPv4 network interface."n"nFor private interfaces, - a gateway is not provided. This is denoted by"nreturning ``nil`` - as its value. + the specified IPv4 network interface. For private interfaces, a + gateway is not provided. This is denoted by returning ``nil`` as + its value. "ip_address": "str", # Optional. The IP address of the IPv4 network interface. "netmask": "str", # Optional. The netmask of @@ -103472,8 +108596,8 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: "netmask": 0, # Optional. The netmask of the IPv6 network interface. "type": "str" # Optional. The type of the - IPv6 network interface."n"n**Note**"" : IPv6 private networking - is not currently supported. "public" + IPv6 network interface. **Note**"" : IPv6 private networking is + not currently supported. "public" } ] }, @@ -103546,6 +108670,15 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: "str" # A flat array including the unique identifier for each Block Storage volume attached to the Droplet. Required. ], + "kernel": { + "id": 0, # Optional. A unique number used to identify and + reference a specific kernel. + "name": "str", # Optional. The display name of the kernel. + This is shown in the web UI and is generally a descriptive title for the + kernel in question. + "version": "str" # Optional. A standard kernel version + string representing the version, patch, and release information. + }, "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Droplet is assigned. } @@ -103562,10 +108695,14 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103574,25 +108711,28 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_get_request( + _request = build_droplets_get_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -103629,12 +108769,13 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def destroy(self, droplet_id: int, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Existing Droplet. To delete a Droplet, send a DELETE request to ``/v2/droplets/$DROPLET_ID``. @@ -103663,10 +108804,14 @@ def destroy(self, droplet_id: int, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103675,25 +108820,28 @@ def destroy(self, droplet_id: int, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_droplets_destroy_request( + _request = build_droplets_destroy_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -103729,14 +108877,15 @@ def destroy(self, droplet_id: int, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_backups( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Backups for a Droplet. To retrieve any backups associated with a Droplet, send a GET request to @@ -103761,6 +108910,9 @@ def list_backups( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "backups": [ { "created_at": "2020-02-20 00:00:00", # A time value given in @@ -103785,9 +108937,6 @@ def list_backups( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -103802,10 +108951,14 @@ def list_backups( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103814,27 +108967,30 @@ def list_backups( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_backups_request( + _request = build_droplets_list_backups_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -103871,14 +109027,15 @@ def list_backups( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_snapshots( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Snapshots for a Droplet. To retrieve the snapshots that have been created from a Droplet, send a GET @@ -103903,12 +109060,12 @@ def list_snapshots( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "snapshots": [ { "created_at": "2020-02-20 00:00:00", # A time value given in @@ -103944,10 +109101,14 @@ def list_snapshots( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -103956,27 +109117,30 @@ def list_snapshots( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_snapshots_request( + _request = build_droplets_list_snapshots_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -104013,14 +109177,15 @@ def list_snapshots( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_kernels( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Available Kernels for a Droplet. To retrieve a list of all kernels available to a Droplet, send a GET request @@ -104045,6 +109210,9 @@ def list_kernels( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "kernels": [ { "id": 0, # Optional. A unique number used to identify and @@ -104058,9 +109226,6 @@ def list_kernels( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -104075,10 +109240,14 @@ def list_kernels( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -104087,27 +109256,30 @@ def list_kernels( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_kernels_request( + _request = build_droplets_list_kernels_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -104144,14 +109316,15 @@ def list_kernels( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_firewalls( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List all Firewalls Applied to a Droplet. To retrieve a list of all firewalls available to a Droplet, send a GET request @@ -104176,6 +109349,9 @@ def list_firewalls( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "firewalls": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -104290,9 +109466,6 @@ def list_firewalls( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -104307,10 +109480,14 @@ def list_firewalls( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -104319,27 +109496,30 @@ def list_firewalls( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_firewalls_request( + _request = build_droplets_list_firewalls_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -104376,12 +109556,13 @@ def list_firewalls( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Neighbors for a Droplet. To retrieve a list of any "neighbors" (i.e. Droplets that are co-located on @@ -104439,7 +109620,7 @@ def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string - containing information about errors that may occur when importing"n a + containing information about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. @@ -104464,7 +109645,7 @@ def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string - indicating the state of a custom image. This may be ``NEW``"" ,"n + indicating the state of a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". @@ -104482,16 +109663,6 @@ def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: (e.g. DOKS worker nodes). Known values are: "base", "snapshot", "backup", "custom", and "admin". }, - "kernel": { - "id": 0, # Optional. A unique number used to - identify and reference a specific kernel. - "name": "str", # Optional. The display name of the - kernel. This is shown in the web UI and is generally a descriptive - title for the kernel in question. - "version": "str" # Optional. A standard kernel - version string representing the version, patch, and release - information. - }, "locked": bool, # A boolean value indicating whether the Droplet has been locked, preventing actions by users. Required. "memory": 0, # Memory of the Droplet in megabytes. Required. @@ -104501,9 +109672,9 @@ def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: "v4": [ { "gateway": "str", # Optional. The - gateway of the specified IPv4 network interface."n"nFor - private interfaces, a gateway is not provided. This is - denoted by"nreturning ``nil`` as its value. + gateway of the specified IPv4 network interface. For private + interfaces, a gateway is not provided. This is denoted by + returning ``nil`` as its value. "ip_address": "str", # Optional. The IP address of the IPv4 network interface. "netmask": "str", # Optional. The @@ -104522,7 +109693,7 @@ def list_neighbors(self, droplet_id: int, **kwargs: Any) -> JSON: "netmask": 0, # Optional. The netmask of the IPv6 network interface. "type": "str" # Optional. The type - of the IPv6 network interface."n"n**Note**"" : IPv6 private + of the IPv6 network interface. **Note**"" : IPv6 private networking is not currently supported. "public" } ] @@ -104601,6 +109772,16 @@ class of Droplets created from this size. For example: Basic, General "str" # A flat array including the unique identifier for each Block Storage volume attached to the Droplet. Required. ], + "kernel": { + "id": 0, # Optional. A unique number used to + identify and reference a specific kernel. + "name": "str", # Optional. The display name of the + kernel. This is shown in the web UI and is generally a descriptive + title for the kernel in question. + "version": "str" # Optional. A standard kernel + version string representing the version, patch, and release + information. + }, "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Droplet is assigned. } @@ -104618,10 +109799,14 @@ class of Droplets created from this size. For example: Basic, General tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -104630,25 +109815,28 @@ class of Droplets created from this size. For example: Basic, General _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_neighbors_request( + _request = build_droplets_list_neighbors_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -104685,19 +109873,20 @@ class of Droplets created from this size. For example: Basic, General deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_associated_resources(self, droplet_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Associated Resources for a Droplet. To list the associated billable resources that can be destroyed along with a Droplet, send a GET request to the ``/v2/droplets/$DROPLET_ID/destroy_with_associated_resources`` endpoint. - The response will be a JSON object containing ``snapshots``\ , ``volumes``\ , and + The response will be a JSON object containing ``snapshots``\\ , ``volumes``\\ , and ``volume_snapshots`` keys. Each will be set to an array of objects containing information about the associated resources. @@ -104775,10 +109964,14 @@ def list_associated_resources(self, droplet_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -104787,25 +109980,28 @@ def list_associated_resources(self, droplet_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_associated_resources_request( + _request = build_droplets_list_associated_resources_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -104842,12 +110038,12 @@ def list_associated_resources(self, droplet_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload - def destroy_with_associated_resources_selective( + def destroy_with_associated_resources_selective( # pylint: disable=name-too-long self, droplet_id: int, body: Optional[JSON] = None, @@ -104855,12 +110051,13 @@ def destroy_with_associated_resources_selective( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Destroy a Droplet and its Associated Resources. To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the ``/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`` - endpoint. The JSON body of the request should include ``reserved_ips``\ , ``snapshots``\ , - ``volumes``\ , + endpoint. The JSON body of the request should include ``reserved_ips``\\ , ``snapshots``\\ , + ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request @@ -104922,20 +110119,21 @@ def destroy_with_associated_resources_selective( """ @overload - def destroy_with_associated_resources_selective( + def destroy_with_associated_resources_selective( # pylint: disable=name-too-long self, droplet_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Destroy a Droplet and its Associated Resources. To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the ``/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`` - endpoint. The JSON body of the request should include ``reserved_ips``\ , ``snapshots``\ , - ``volumes``\ , + endpoint. The JSON body of the request should include ``reserved_ips``\\ , ``snapshots``\\ , + ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request @@ -104948,7 +110146,7 @@ def destroy_with_associated_resources_selective( :param droplet_id: A unique identifier for a Droplet instance. Required. :type droplet_id: int :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -104973,15 +110171,19 @@ def destroy_with_associated_resources_selective( """ @distributed_trace - def destroy_with_associated_resources_selective( - self, droplet_id: int, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + def destroy_with_associated_resources_selective( # pylint: disable=name-too-long + self, + droplet_id: int, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Destroy a Droplet and its Associated Resources. To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the ``/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`` - endpoint. The JSON body of the request should include ``reserved_ips``\ , ``snapshots``\ , - ``volumes``\ , + endpoint. The JSON body of the request should include ``reserved_ips``\\ , ``snapshots``\\ , + ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request @@ -104993,11 +110195,8 @@ def destroy_with_associated_resources_selective( :param droplet_id: A unique identifier for a Droplet instance. Required. :type droplet_id: int - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -105005,6 +110204,30 @@ def destroy_with_associated_resources_selective( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "floating_ips": [ + "str" # Optional. An array of unique identifiers for the floating + IPs to be scheduled for deletion. + ], + "reserved_ips": [ + "str" # Optional. An array of unique identifiers for the reserved + IPs to be scheduled for deletion. + ], + "snapshots": [ + "str" # Optional. An array of unique identifiers for the snapshots + to be scheduled for deletion. + ], + "volume_snapshots": [ + "str" # Optional. An array of unique identifiers for the volume + snapshots to be scheduled for deletion. + ], + "volumes": [ + "str" # Optional. An array of unique identifiers for the volumes to + be scheduled for deletion. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -105017,10 +110240,14 @@ def destroy_with_associated_resources_selective( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105029,15 +110256,15 @@ def destroy_with_associated_resources_selective( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -105045,7 +110272,7 @@ def destroy_with_associated_resources_selective( else: _json = None - request = build_droplets_destroy_with_associated_resources_selective_request( + _request = build_droplets_destroy_with_associated_resources_selective_request( droplet_id=droplet_id, content_type=content_type, json=_json, @@ -105053,18 +110280,21 @@ def destroy_with_associated_resources_selective( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -105097,14 +110327,15 @@ def destroy_with_associated_resources_selective( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace - def destroy_with_associated_resources_dangerous( + def destroy_with_associated_resources_dangerous( # pylint: disable=name-too-long self, droplet_id: int, *, x_dangerous: bool, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Destroy a Droplet and All of its Associated Resources (Dangerous). To destroy a Droplet along with all of its associated resources, send a DELETE @@ -105142,10 +110373,14 @@ def destroy_with_associated_resources_dangerous( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105154,26 +110389,29 @@ def destroy_with_associated_resources_dangerous( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_droplets_destroy_with_associated_resources_dangerous_request( + _request = build_droplets_destroy_with_associated_resources_dangerous_request( droplet_id=droplet_id, x_dangerous=x_dangerous, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -105206,14 +110444,15 @@ def destroy_with_associated_resources_dangerous( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_destroy_associated_resources_status( self, droplet_id: int, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Check Status of a Droplet Destroy with Associated Resources Request. To check on the status of a request to destroy a Droplet with its associated @@ -105332,10 +110571,14 @@ def get_destroy_associated_resources_status( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105344,25 +110587,28 @@ def get_destroy_associated_resources_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_get_destroy_associated_resources_status_request( + _request = build_droplets_get_destroy_associated_resources_status_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -105399,14 +110645,15 @@ def get_destroy_associated_resources_status( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def destroy_retry_with_associated_resources( self, droplet_id: int, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Retry a Droplet Destroy with Associated Resources Request. If the status of a request to destroy a Droplet with its associated resources @@ -105439,10 +110686,14 @@ def destroy_retry_with_associated_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105451,25 +110702,28 @@ def destroy_retry_with_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_droplets_destroy_retry_with_associated_resources_request( + _request = build_droplets_destroy_retry_with_associated_resources_request( droplet_id=droplet_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404, 409]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -105518,12 +110772,13 @@ def destroy_retry_with_associated_resources( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_neighbors_ids(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Droplet Neighbors. To retrieve a list of all Droplets that are co-located on the same physical @@ -105563,10 +110818,14 @@ def list_neighbors_ids(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105575,24 +110834,27 @@ def list_neighbors_ids(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplets_list_neighbors_ids_request( + _request = build_droplets_list_neighbors_ids_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -105629,9 +110891,9 @@ def list_neighbors_ids(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class DropletActionsOperations: @@ -105657,6 +110919,7 @@ def __init__(self, *args, **kwargs): def list( self, droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Actions for a Droplet. To retrieve a list of all actions that have been executed for a Droplet, send @@ -105681,6 +110944,9 @@ def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -105722,9 +110988,6 @@ def list( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -105739,10 +111002,14 @@ def list( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -105751,27 +111018,30 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplet_actions_list_request( + _request = build_droplet_actions_list_request( droplet_id=droplet_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -105808,9 +111078,9 @@ def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def post( @@ -105821,6 +111091,7 @@ def post( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate a Droplet Action. To initiate an action on a Droplet send a POST request to @@ -105953,11 +111224,12 @@ def post( def post( self, droplet_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate a Droplet Action. To initiate an action on a Droplet send a POST request to @@ -106021,7 +111293,7 @@ def post( :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional attributes to be set as well. Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -106085,8 +111357,12 @@ def post( @distributed_trace def post( - self, droplet_id: int, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + droplet_id: int, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate a Droplet Action. To initiate an action on a Droplet send a POST request to @@ -106149,11 +111425,9 @@ def post( :type droplet_id: int :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional - attributes to be set as well. Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + attributes to be set as well. Is either a JSON type or a IO[bytes] type. Default value is + None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -106161,6 +111435,9 @@ def post( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "action": { @@ -106211,10 +111488,14 @@ def post( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106223,15 +111504,15 @@ def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -106239,7 +111520,7 @@ def post( else: _json = None - request = build_droplet_actions_post_request( + _request = build_droplet_actions_post_request( droplet_id=droplet_id, content_type=content_type, json=_json, @@ -106247,18 +111528,21 @@ def post( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -106295,9 +111579,9 @@ def post( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def post_by_tag( @@ -106308,6 +111592,7 @@ def post_by_tag( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Acting on Tagged Droplets. Some actions can be performed in bulk on tagged Droplets. The actions can be @@ -106393,12 +111678,13 @@ def post_by_tag( @overload def post_by_tag( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, tag_name: Optional[str] = None, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Acting on Tagged Droplets. Some actions can be performed in bulk on tagged Droplets. The actions can be @@ -106420,7 +111706,7 @@ def post_by_tag( :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional attributes to be set as well. Default value is None. - :type body: IO + :type body: IO[bytes] :keyword tag_name: Used to filter Droplets by a specific tag. Can not be combined with ``name``. Default value is None. :paramtype tag_name: str @@ -106481,11 +111767,12 @@ def post_by_tag( @distributed_trace def post_by_tag( self, - body: Optional[Union[JSON, IO]] = None, + body: Optional[Union[JSON, IO[bytes]]] = None, *, tag_name: Optional[str] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Acting on Tagged Droplets. Some actions can be performed in bulk on tagged Droplets. The actions can be @@ -106506,14 +111793,12 @@ def post_by_tag( :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional - attributes to be set as well. Is either a model type or a IO type. Default value is None. - :type body: JSON or IO + attributes to be set as well. Is either a JSON type or a IO[bytes] type. Default value is + None. + :type body: JSON or IO[bytes] :keyword tag_name: Used to filter Droplets by a specific tag. Can not be combined with ``name``. Default value is None. :paramtype tag_name: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -106521,6 +111806,9 @@ def post_by_tag( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "actions": [ @@ -106564,10 +111852,14 @@ def post_by_tag( ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106576,15 +111868,15 @@ def post_by_tag( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -106592,7 +111884,7 @@ def post_by_tag( else: _json = None - request = build_droplet_actions_post_by_tag_request( + _request = build_droplet_actions_post_by_tag_request( tag_name=tag_name, content_type=content_type, json=_json, @@ -106600,18 +111892,21 @@ def post_by_tag( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -106631,12 +111926,13 @@ def post_by_tag( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, droplet_id: int, action_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve a Droplet Action. To retrieve a Droplet action, send a GET request to @@ -106707,10 +112003,14 @@ def get(self, droplet_id: int, action_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106719,26 +112019,29 @@ def get(self, droplet_id: int, action_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_droplet_actions_get_request( + _request = build_droplet_actions_get_request( droplet_id=droplet_id, action_id=action_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -106775,9 +112078,9 @@ def get(self, droplet_id: int, action_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class FirewallsOperations: @@ -106801,6 +112104,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Firewalls. To list all of the firewalls available on your account, send a GET request to @@ -106819,6 +112123,9 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "firewalls": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -106933,16 +112240,17 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -106951,26 +112259,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_firewalls_list_request( + _request = build_firewalls_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -106990,9 +112301,9 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( @@ -107002,6 +112313,7 @@ def create( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Firewall. To create a new firewall, send a POST request to ``/v2/firewalls``. The request @@ -107247,18 +112559,19 @@ def create( @overload def create( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Firewall. To create a new firewall, send a POST request to ``/v2/firewalls``. The request must contain at least one inbound or outbound access rule. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -107393,17 +112706,17 @@ def create( """ @distributed_trace - def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: + def create( + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Create a New Firewall. To create a new firewall, send a POST request to ``/v2/firewalls``. The request must contain at least one inbound or outbound access rule. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -107411,6 +112724,108 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the firewall was + created. + "droplet_ids": [ + 0 # Optional. An array containing the IDs of the Droplets assigned + to the firewall. + ], + "id": "str", # Optional. A unique ID that can be used to identify and + reference a firewall. + "inbound_rules": [ + { + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str", # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + "sources": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + } + } + ], + "name": "str", # Optional. A human-readable name for a firewall. The name + must begin with an alphanumeric character. Subsequent characters must either be + alphanumeric characters, a period (.), or a dash (-). + "outbound_rules": [ + { + "destinations": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + }, + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str" # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + } + ], + "pending_changes": [ + { + "droplet_id": 0, # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + "removing": bool, # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + "status": "str" # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + } + ], + "status": "str", # Optional. A status string indicating the current state of + the firewall. This can be "waiting", "succeeded", or "failed". Known values are: + "waiting", "succeeded", and "failed". + "tags": {} # Optional. Any object. + } + # response body for status code(s): 202 response == { "firewall": { @@ -107533,10 +112948,14 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -107545,15 +112964,15 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -107561,25 +112980,28 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: else: _json = None - request = build_firewalls_create_request( + _request = build_firewalls_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 400]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -107616,12 +113038,13 @@ def create(self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, firewall_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Firewall. To show information about an existing firewall, send a GET request to @@ -107759,10 +113182,14 @@ def get(self, firewall_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -107771,25 +113198,28 @@ def get(self, firewall_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_firewalls_get_request( + _request = build_firewalls_get_request( firewall_id=firewall_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -107826,9 +113256,9 @@ def get(self, firewall_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update( @@ -107839,6 +113269,7 @@ def update( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Firewall. To update the configuration of an existing firewall, send a PUT request to @@ -108090,11 +113521,12 @@ def update( def update( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Firewall. To update the configuration of an existing firewall, send a PUT request to @@ -108106,7 +113538,7 @@ def update( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -108242,8 +113674,12 @@ def update( @distributed_trace def update( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Firewall. To update the configuration of an existing firewall, send a PUT request to @@ -108254,11 +113690,8 @@ def update( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -108266,6 +113699,108 @@ def update( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the firewall was + created. + "droplet_ids": [ + 0 # Optional. An array containing the IDs of the Droplets assigned + to the firewall. + ], + "id": "str", # Optional. A unique ID that can be used to identify and + reference a firewall. + "inbound_rules": [ + { + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str", # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + "sources": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + } + } + ], + "name": "str", # Optional. A human-readable name for a firewall. The name + must begin with an alphanumeric character. Subsequent characters must either be + alphanumeric characters, a period (.), or a dash (-). + "outbound_rules": [ + { + "destinations": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + }, + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str" # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + } + ], + "pending_changes": [ + { + "droplet_id": 0, # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + "removing": bool, # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + "status": "str" # Optional. An array of objects each + containing the fields "droplet_id", "removing", and "status". It is + provided to detail exactly which Droplets are having their security + policies updated. When empty, all changes have been successfully applied. + } + ], + "status": "str", # Optional. A status string indicating the current state of + the firewall. This can be "waiting", "succeeded", or "failed". Known values are: + "waiting", "succeeded", and "failed". + "tags": {} # Optional. Any object. + } + # response body for status code(s): 200 response == { "firewall": { @@ -108388,10 +113923,14 @@ def update( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -108400,15 +113939,15 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -108416,7 +113955,7 @@ def update( else: _json = None - request = build_firewalls_update_request( + _request = build_firewalls_update_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -108424,18 +113963,21 @@ def update( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -108488,12 +114030,13 @@ def update( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, firewall_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Firewall. To delete a firewall send a DELETE request to ``/v2/firewalls/$FIREWALL_ID``. @@ -108524,10 +114067,14 @@ def delete(self, firewall_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -108536,25 +114083,28 @@ def delete(self, firewall_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_firewalls_delete_request( + _request = build_firewalls_delete_request( firewall_id=firewall_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -108587,9 +114137,9 @@ def delete(self, firewall_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def assign_droplets( @@ -108600,6 +114150,7 @@ def assign_droplets( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Firewall. To assign a Droplet to a firewall, send a POST request to @@ -108650,11 +114201,12 @@ def assign_droplets( def assign_droplets( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Firewall. To assign a Droplet to a firewall, send a POST request to @@ -108669,7 +114221,7 @@ def assign_droplets( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -108695,8 +114247,12 @@ def assign_droplets( @distributed_trace def assign_droplets( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Firewall. To assign a Droplet to a firewall, send a POST request to @@ -108710,11 +114266,8 @@ def assign_droplets( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -108722,6 +114275,14 @@ def assign_droplets( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "droplet_ids": [ + 0 # An array containing the IDs of the Droplets to be assigned to + the firewall. Required. + ] + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -108734,10 +114295,14 @@ def assign_droplets( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -108746,15 +114311,15 @@ def assign_droplets( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -108762,7 +114327,7 @@ def assign_droplets( else: _json = None - request = build_firewalls_assign_droplets_request( + _request = build_firewalls_assign_droplets_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -108770,18 +114335,21 @@ def assign_droplets( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -108830,9 +114398,9 @@ def assign_droplets( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def delete_droplets( @@ -108843,6 +114411,7 @@ def delete_droplets( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Firewall. To remove a Droplet from a firewall, send a DELETE request to @@ -108893,11 +114462,12 @@ def delete_droplets( def delete_droplets( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Firewall. To remove a Droplet from a firewall, send a DELETE request to @@ -108912,7 +114482,7 @@ def delete_droplets( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -108938,8 +114508,12 @@ def delete_droplets( @distributed_trace def delete_droplets( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Firewall. To remove a Droplet from a firewall, send a DELETE request to @@ -108953,11 +114527,8 @@ def delete_droplets( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -108965,6 +114536,14 @@ def delete_droplets( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "droplet_ids": [ + 0 # An array containing the IDs of the Droplets to be removed from + the firewall. Required. + ] + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -108977,10 +114556,14 @@ def delete_droplets( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -108989,15 +114572,15 @@ def delete_droplets( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -109005,7 +114588,7 @@ def delete_droplets( else: _json = None - request = build_firewalls_delete_droplets_request( + _request = build_firewalls_delete_droplets_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -109013,18 +114596,21 @@ def delete_droplets( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -109073,9 +114659,9 @@ def delete_droplets( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def add_tags( @@ -109086,6 +114672,7 @@ def add_tags( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Tags to a Firewall. To assign a tag representing a group of Droplets to a firewall, send a POST @@ -109133,11 +114720,12 @@ def add_tags( def add_tags( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Tags to a Firewall. To assign a tag representing a group of Droplets to a firewall, send a POST @@ -109152,7 +114740,7 @@ def add_tags( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -109178,8 +114766,12 @@ def add_tags( @distributed_trace def add_tags( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Tags to a Firewall. To assign a tag representing a group of Droplets to a firewall, send a POST @@ -109193,11 +114785,8 @@ def add_tags( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -109205,6 +114794,11 @@ def add_tags( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "tags": {} # Any object. Required. + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -109217,10 +114811,14 @@ def add_tags( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109229,15 +114827,15 @@ def add_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -109245,7 +114843,7 @@ def add_tags( else: _json = None - request = build_firewalls_add_tags_request( + _request = build_firewalls_add_tags_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -109253,18 +114851,21 @@ def add_tags( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -109313,9 +114914,9 @@ def add_tags( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def delete_tags( @@ -109326,6 +114927,7 @@ def delete_tags( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Tags from a Firewall. To remove a tag representing a group of Droplets from a firewall, send a @@ -109373,11 +114975,12 @@ def delete_tags( def delete_tags( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Tags from a Firewall. To remove a tag representing a group of Droplets from a firewall, send a @@ -109392,7 +114995,7 @@ def delete_tags( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -109418,8 +115021,12 @@ def delete_tags( @distributed_trace def delete_tags( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Tags from a Firewall. To remove a tag representing a group of Droplets from a firewall, send a @@ -109433,11 +115040,8 @@ def delete_tags( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -109445,6 +115049,11 @@ def delete_tags( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "tags": {} # Any object. Required. + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -109457,10 +115066,14 @@ def delete_tags( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109469,15 +115082,15 @@ def delete_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -109485,7 +115098,7 @@ def delete_tags( else: _json = None - request = build_firewalls_delete_tags_request( + _request = build_firewalls_delete_tags_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -109493,18 +115106,21 @@ def delete_tags( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -109553,9 +115169,9 @@ def delete_tags( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def add_rules( @@ -109566,6 +115182,7 @@ def add_rules( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Rules to a Firewall. To add additional access rules to a firewall, send a POST request to @@ -109679,11 +115296,12 @@ def add_rules( def add_rules( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Rules to a Firewall. To add additional access rules to a firewall, send a POST request to @@ -109699,7 +115317,7 @@ def add_rules( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -109725,8 +115343,12 @@ def add_rules( @distributed_trace def add_rules( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Rules to a Firewall. To add additional access rules to a firewall, send a POST request to @@ -109741,11 +115363,8 @@ def add_rules( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -109753,6 +115372,76 @@ def add_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "inbound_rules": [ + { + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str", # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + "sources": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + } + } + ], + "outbound_rules": [ + { + "destinations": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + }, + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str" # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + } + ] + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -109765,10 +115454,14 @@ def add_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -109777,15 +115470,15 @@ def add_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -109793,7 +115486,7 @@ def add_rules( else: _json = None - request = build_firewalls_add_rules_request( + _request = build_firewalls_add_rules_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -109801,18 +115494,21 @@ def add_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -109861,9 +115557,9 @@ def add_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def delete_rules( @@ -109874,6 +115570,7 @@ def delete_rules( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Rules from a Firewall. To remove access rules from a firewall, send a DELETE request to @@ -109987,11 +115684,12 @@ def delete_rules( def delete_rules( self, firewall_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Rules from a Firewall. To remove access rules from a firewall, send a DELETE request to @@ -110007,7 +115705,7 @@ def delete_rules( Required. :type firewall_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -110033,8 +115731,12 @@ def delete_rules( @distributed_trace def delete_rules( - self, firewall_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + firewall_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Rules from a Firewall. To remove access rules from a firewall, send a DELETE request to @@ -110049,11 +115751,8 @@ def delete_rules( :param firewall_id: A unique ID that can be used to identify and reference a firewall. Required. :type firewall_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -110061,6 +115760,76 @@ def delete_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "inbound_rules": [ + { + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str", # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + "sources": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + } + } + ], + "outbound_rules": [ + { + "destinations": { + "addresses": [ + "str" # Optional. An array of strings + containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or + IPv6 CIDRs to which the firewall will allow traffic. + ], + "droplet_ids": [ + 0 # Optional. An array containing the IDs of + the Droplets to which the firewall will allow traffic. + ], + "kubernetes_ids": [ + "str" # Optional. An array containing the + IDs of the Kubernetes clusters to which the firewall will allow + traffic. + ], + "load_balancer_uids": [ + "str" # Optional. An array containing the + IDs of the load balancers to which the firewall will allow + traffic. + ], + "tags": {} # Optional. Any object. + }, + "ports": "str", # The ports on which traffic will be allowed + specified as a string containing a single port, a range (e.g. + "8000-9000"), or "0" when all ports are open for a protocol. For ICMP + rules this parameter will always return "0". Required. + "protocol": "str" # The type of traffic to be allowed. This + may be one of ``tcp``"" , ``udp``"" , or ``icmp``. Required. Known values + are: "tcp", "udp", and "icmp". + } + ] + } + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -110073,10 +115842,14 @@ def delete_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -110085,15 +115858,15 @@ def delete_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -110101,7 +115874,7 @@ def delete_rules( else: _json = None - request = build_firewalls_delete_rules_request( + _request = build_firewalls_delete_rules_request( firewall_id=firewall_id, content_type=content_type, json=_json, @@ -110109,18 +115882,21 @@ def delete_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -110169,9 +115945,9 @@ def delete_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class FunctionsOperations: @@ -110195,6 +115971,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list_namespaces(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Namespaces. Returns a list of namespaces associated with the current user. To get all namespaces, send a @@ -110217,7 +115994,7 @@ def list_namespaces(self, **kwargs: Any) -> JSON: "created_at": "str", # Optional. UTC time string. "key": "str", # Optional. A random alpha numeric string. This key is used in conjunction with the namespace's UUID to authenticate - "na user to use the namespace via ``doctl``"" , DigitalOcean's official + a user to use the namespace via ``doctl``"" , DigitalOcean's official CLI. "label": "str", # Optional. The namespace's unique name. "namespace": "str", # Optional. A unique string format of @@ -110231,10 +116008,14 @@ def list_namespaces(self, **kwargs: Any) -> JSON: ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -110243,24 +116024,27 @@ def list_namespaces(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_functions_list_namespaces_request( + _request = build_functions_list_namespaces_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -110280,14 +116064,15 @@ def list_namespaces(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_namespace( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Namespace. Creates a new serverless functions namespace in the desired region and associates it with the @@ -110322,7 +116107,62 @@ def create_namespace( function in a namespace is provided an endpoint at the namespace's hostname. "created_at": "str", # Optional. UTC time string. "key": "str", # Optional. A random alpha numeric string. This key is - used in conjunction with the namespace's UUID to authenticate "na user to use + used in conjunction with the namespace's UUID to authenticate a user to use + the namespace via ``doctl``"" , DigitalOcean's official CLI. + "label": "str", # Optional. The namespace's unique name. + "namespace": "str", # Optional. A unique string format of UUID with + a prefix fn-. + "region": "str", # Optional. The namespace's datacenter region. + "updated_at": "str", # Optional. UTC time string. + "uuid": "str" # Optional. The namespace's Universally Unique + Identifier. + } + } + # response body for status code(s): 404, 422 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def create_namespace( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create Namespace. + + Creates a new serverless functions namespace in the desired region and associates it with the + provided label. A namespace is a collection of functions and their associated packages, + triggers, and project specifications. To create a namespace, send a POST request to + ``/v2/functions/namespaces`` with the ``region`` and ``label`` properties. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "namespace": { + "api_host": "str", # Optional. The namespace's API hostname. Each + function in a namespace is provided an endpoint at the namespace's hostname. + "created_at": "str", # Optional. UTC time string. + "key": "str", # Optional. A random alpha numeric string. This key is + used in conjunction with the namespace's UUID to authenticate a user to use the namespace via ``doctl``"" , DigitalOcean's official CLI. "label": "str", # Optional. The namespace's unique name. "namespace": "str", # Optional. A unique string format of UUID with @@ -110346,10 +116186,9 @@ def create_namespace( } """ - @overload - def create_namespace( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: + @distributed_trace + def create_namespace(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create Namespace. Creates a new serverless functions namespace in the desired region and associates it with the @@ -110357,11 +116196,8 @@ def create_namespace( triggers, and project specifications. To create a namespace, send a POST request to ``/v2/functions/namespaces`` with the ``region`` and ``label`` properties. - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -110369,57 +116205,13 @@ def create_namespace( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "namespace": { - "api_host": "str", # Optional. The namespace's API hostname. Each - function in a namespace is provided an endpoint at the namespace's hostname. - "created_at": "str", # Optional. UTC time string. - "key": "str", # Optional. A random alpha numeric string. This key is - used in conjunction with the namespace's UUID to authenticate "na user to use - the namespace via ``doctl``"" , DigitalOcean's official CLI. - "label": "str", # Optional. The namespace's unique name. - "namespace": "str", # Optional. A unique string format of UUID with - a prefix fn-. - "region": "str", # Optional. The namespace's datacenter region. - "updated_at": "str", # Optional. UTC time string. - "uuid": "str" # Optional. The namespace's Universally Unique - Identifier. - } - } - # response body for status code(s): 404, 422 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. + # JSON input template you can fill out and use as your body input. + body = { + "label": "str", # The namespace's unique name. Required. + "region": "str" # The `datacenter region + `_ + in which to create the namespace. Required. } - """ - - @distributed_trace - def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Create Namespace. - - Creates a new serverless functions namespace in the desired region and associates it with the - provided label. A namespace is a collection of functions and their associated packages, - triggers, and project specifications. To create a namespace, send a POST request to - ``/v2/functions/namespaces`` with the ``region`` and ``label`` properties. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { @@ -110428,7 +116220,7 @@ def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: function in a namespace is provided an endpoint at the namespace's hostname. "created_at": "str", # Optional. UTC time string. "key": "str", # Optional. A random alpha numeric string. This key is - used in conjunction with the namespace's UUID to authenticate "na user to use + used in conjunction with the namespace's UUID to authenticate a user to use the namespace via ``doctl``"" , DigitalOcean's official CLI. "label": "str", # Optional. The namespace's unique name. "namespace": "str", # Optional. A unique string format of UUID with @@ -110451,10 +116243,14 @@ def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -110463,38 +116259,41 @@ def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_functions_create_namespace_request( + _request = build_functions_create_namespace_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404, 422]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -110547,12 +116346,13 @@ def create_namespace(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Namespace. Gets the namespace details for the given namespace UUID. To get namespace details, send a GET @@ -110574,7 +116374,7 @@ def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: function in a namespace is provided an endpoint at the namespace's hostname. "created_at": "str", # Optional. UTC time string. "key": "str", # Optional. A random alpha numeric string. This key is - used in conjunction with the namespace's UUID to authenticate "na user to use + used in conjunction with the namespace's UUID to authenticate a user to use the namespace via ``doctl``"" , DigitalOcean's official CLI. "label": "str", # Optional. The namespace's unique name. "namespace": "str", # Optional. A unique string format of UUID with @@ -110597,10 +116397,14 @@ def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -110609,25 +116413,28 @@ def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_functions_get_namespace_request( + _request = build_functions_get_namespace_request( namespace_id=namespace_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 403, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -110680,12 +116487,13 @@ def get_namespace(self, namespace_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_namespace(self, namespace_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Namespace. Deletes the given namespace. When a namespace is deleted all assets, in the namespace are @@ -110716,10 +116524,14 @@ def delete_namespace(self, namespace_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -110728,25 +116540,28 @@ def delete_namespace(self, namespace_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_functions_delete_namespace_request( + _request = build_functions_delete_namespace_request( namespace_id=namespace_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -110779,12 +116594,13 @@ def delete_namespace(self, namespace_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Triggers. Returns a list of triggers associated with the current user and namespace. To get all triggers, @@ -110813,12 +116629,12 @@ def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which + is required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which - is required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run @@ -110844,10 +116660,14 @@ def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -110856,25 +116676,28 @@ def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_functions_list_triggers_request( + _request = build_functions_list_triggers_request( namespace_id=namespace_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -110911,9 +116734,9 @@ def list_triggers(self, namespace_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_trigger( @@ -110924,11 +116747,12 @@ def create_trigger( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create Trigger. Creates a new trigger for a given function in a namespace. To create a trigger, send a POST - request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\ , - ``function``\ , ``type``\ , ``is_enabled`` and ``scheduled_details`` properties. + request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\\ , + ``function``\\ , ``type``\\ , ``is_enabled`` and ``scheduled_details`` properties. :param namespace_id: The ID of the namespace to be managed. Required. :type namespace_id: str @@ -110952,12 +116776,12 @@ def create_trigger( Required. "name": "str", # The trigger's unique name within the namespace. Required. "scheduled_details": { + "cron": "str", # valid cron expression string which is required for + SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is required for - SCHEDULED type triggers. Required. + } }, "type": "str" # One of different type of triggers. Currently only SCHEDULED is supported. Required. @@ -110976,12 +116800,12 @@ def create_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -111011,21 +116835,22 @@ def create_trigger( def create_trigger( self, namespace_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create Trigger. Creates a new trigger for a given function in a namespace. To create a trigger, send a POST - request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\ , - ``function``\ , ``type``\ , ``is_enabled`` and ``scheduled_details`` properties. + request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\\ , + ``function``\\ , ``type``\\ , ``is_enabled`` and ``scheduled_details`` properties. :param namespace_id: The ID of the namespace to be managed. Required. :type namespace_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -111049,12 +116874,12 @@ def create_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -111082,21 +116907,19 @@ def create_trigger( @distributed_trace def create_trigger( - self, namespace_id: str, body: Union[JSON, IO], **kwargs: Any + self, namespace_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Trigger. Creates a new trigger for a given function in a namespace. To create a trigger, send a POST - request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\ , - ``function``\ , ``type``\ , ``is_enabled`` and ``scheduled_details`` properties. + request to ``/v2/functions/namespaces/$NAMESPACE_ID/triggers`` with the ``name``\\ , + ``function``\\ , ``type``\\ , ``is_enabled`` and ``scheduled_details`` properties. :param namespace_id: The ID of the namespace to be managed. Required. :type namespace_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -111104,6 +116927,25 @@ def create_trigger( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "function": "str", # Name of function(action) that exists in the given + namespace. Required. + "is_enabled": bool, # Indicates weather the trigger is paused or unpaused. + Required. + "name": "str", # The trigger's unique name within the namespace. Required. + "scheduled_details": { + "cron": "str", # valid cron expression string which is required for + SCHEDULED type triggers. Required. + "body": { + "name": "str" # Optional. Optional data to be sent to + function while triggering the function. + } + }, + "type": "str" # One of different type of triggers. Currently only SCHEDULED + is supported. Required. + } + # response body for status code(s): 200 response == { "trigger": { @@ -111117,12 +116959,12 @@ def create_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -111147,10 +116989,14 @@ def create_trigger( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111159,20 +117005,20 @@ def create_trigger( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_functions_create_trigger_request( + _request = build_functions_create_trigger_request( namespace_id=namespace_id, content_type=content_type, json=_json, @@ -111180,18 +117026,21 @@ def create_trigger( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404, 422]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -111260,12 +117109,13 @@ def create_trigger( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_trigger(self, namespace_id: str, trigger_name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Trigger. Gets the trigger details. To get the trigger details, send a GET request to @@ -111295,12 +117145,12 @@ def get_trigger(self, namespace_id: str, trigger_name: str, **kwargs: Any) -> JS "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -111325,10 +117175,14 @@ def get_trigger(self, namespace_id: str, trigger_name: str, **kwargs: Any) -> JS tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111337,26 +117191,29 @@ def get_trigger(self, namespace_id: str, trigger_name: str, **kwargs: Any) -> JS _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_functions_get_trigger_request( + _request = build_functions_get_trigger_request( namespace_id=namespace_id, trigger_name=trigger_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -111393,9 +117250,9 @@ def get_trigger(self, namespace_id: str, trigger_name: str, **kwargs: Any) -> JS deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_trigger( @@ -111407,6 +117264,7 @@ def update_trigger( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Trigger. Updates the details of the given trigger. To update a trigger, send a PUT request to @@ -111434,12 +117292,12 @@ def update_trigger( "is_enabled": bool, # Optional. Indicates weather the trigger is paused or unpaused. "scheduled_details": { + "cron": "str", # valid cron expression string which is required for + SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is required for - SCHEDULED type triggers. Required. + } } } @@ -111456,12 +117314,12 @@ def update_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -111492,11 +117350,12 @@ def update_trigger( self, namespace_id: str, trigger_name: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Trigger. Updates the details of the given trigger. To update a trigger, send a PUT request to @@ -111508,7 +117367,7 @@ def update_trigger( :param trigger_name: The name of the trigger to be managed. Required. :type trigger_name: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -111532,12 +117391,12 @@ def update_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -111565,8 +117424,13 @@ def update_trigger( @distributed_trace def update_trigger( - self, namespace_id: str, trigger_name: str, body: Union[JSON, IO], **kwargs: Any + self, + namespace_id: str, + trigger_name: str, + body: Union[JSON, IO[bytes]], + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Trigger. Updates the details of the given trigger. To update a trigger, send a PUT request to @@ -111577,11 +117441,8 @@ def update_trigger( :type namespace_id: str :param trigger_name: The name of the trigger to be managed. Required. :type trigger_name: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -111589,6 +117450,20 @@ def update_trigger( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "is_enabled": bool, # Optional. Indicates weather the trigger is paused or + unpaused. + "scheduled_details": { + "cron": "str", # valid cron expression string which is required for + SCHEDULED type triggers. Required. + "body": { + "name": "str" # Optional. Optional data to be sent to + function while triggering the function. + } + } + } + # response body for status code(s): 200 response == { "trigger": { @@ -111602,12 +117477,12 @@ def update_trigger( "namespace": "str", # Optional. A unique string format of UUID with a prefix fn-. "scheduled_details": { + "cron": "str", # valid cron expression string which is + required for SCHEDULED type triggers. Required. "body": { "name": "str" # Optional. Optional data to be sent to function while triggering the function. - }, - "cron": "str" # valid cron expression string which is - required for SCHEDULED type triggers. Required. + } }, "scheduled_runs": { "last_run_at": "str", # Optional. Indicates last run time. @@ -111632,10 +117507,14 @@ def update_trigger( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111644,20 +117523,20 @@ def update_trigger( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_functions_update_trigger_request( + _request = build_functions_update_trigger_request( namespace_id=namespace_id, trigger_name=trigger_name, content_type=content_type, @@ -111666,18 +117545,21 @@ def update_trigger( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -111730,14 +117612,15 @@ def update_trigger( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_trigger( self, namespace_id: str, trigger_name: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Trigger. Deletes the given trigger. @@ -111768,10 +117651,14 @@ def delete_trigger( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -111780,26 +117667,29 @@ def delete_trigger( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_functions_delete_trigger_request( + _request = build_functions_delete_trigger_request( namespace_id=namespace_id, trigger_name=trigger_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -111832,9 +117722,9 @@ def delete_trigger( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class ImagesOperations: @@ -111867,6 +117757,7 @@ def list( page: int = 1, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Images. To list all of the images available on your account, send a GET request to /v2/images. @@ -111888,10 +117779,10 @@ def list( Important: The ``type`` query parameter does not directly relate to the ``type`` attribute. - To retrieve only **\ *distribution*\ ** images, include the ``type`` query parameter set to + To retrieve only **\\ *distribution*\\ ** images, include the ``type`` query parameter set to distribution, ``/v2/images?type=distribution``. - To retrieve only **\ *application*\ ** images, include the ``type`` query parameter set to + To retrieve only **\\ *application*\\ ** images, include the ``type`` query parameter set to application, ``/v2/images?type=application``. **User Images** @@ -111941,7 +117832,7 @@ def list( "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing - information about errors that may occur when importing"n a custom image. + information about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB @@ -111965,7 +117856,7 @@ def list( These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the - state of a custom image. This may be ``NEW``"" ,"n ``available``"" , + state of a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -111983,18 +117874,22 @@ def list( and "admin". } ], - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. + }, + "links": { + "pages": {} } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112003,9 +117898,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_images_list_request( + _request = build_images_list_request( type=type, private=private, tag_name=tag_name, @@ -112014,18 +117909,21 @@ def list( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -112045,14 +117943,15 @@ def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_custom( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Custom Image. To create a new custom image, send a POST request to /v2/images. @@ -112076,6 +117975,14 @@ def create_custom( # JSON input template you can fill out and use as your body input. body = { + "region": "str", # The slug identifier for the region where the resource + will initially be available. Required. Known values are: "ams1", "ams2", "ams3", + "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", "sfo2", "sfo3", "sgp1", + and "tor1". + "url": "str", # A URL from which the custom Linux virtual machine image may + be retrieved. The image it points to must be in the raw, qcow2, vhdx, vdi, or + vmdk format. It may be compressed using gzip or bzip2 and must be smaller than + 100 GB after being decompressed. Required. "description": "str", # Optional. An optional free-form text field to describe an image. "distribution": "str", # Optional. The name of a custom image's @@ -112089,18 +117996,10 @@ def create_custom( "name": "str", # Optional. The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question. - "region": "str", # The slug identifier for the region where the resource - will initially be available. Required. Known values are: "ams1", "ams2", "ams3", - "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", "sfo2", "sfo3", "sgp1", - and "tor1". "tags": [ "str" # Optional. A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. - ], - "url": "str" # A URL from which the custom Linux virtual machine image may - be retrieved. The image it points to must be in the raw, qcow2, vhdx, vdi, or - vmdk format. It may be compressed using gzip or bzip2 and must be smaller than - 100 GB after being decompressed. Required. + ] } # response body for status code(s): 202 @@ -112121,7 +118020,7 @@ def create_custom( Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -112144,7 +118043,7 @@ def create_custom( associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -112165,8 +118064,9 @@ def create_custom( @overload def create_custom( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Custom Image. To create a new custom image, send a POST request to /v2/images. @@ -112177,7 +118077,7 @@ def create_custom( being decompressed. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -112206,7 +118106,7 @@ def create_custom( Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -112229,7 +118129,7 @@ def create_custom( associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -112249,7 +118149,8 @@ def create_custom( """ @distributed_trace - def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create_custom(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a Custom Image. To create a new custom image, send a POST request to /v2/images. @@ -112259,11 +118160,8 @@ def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -112271,6 +118169,35 @@ def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "region": "str", # The slug identifier for the region where the resource + will initially be available. Required. Known values are: "ams1", "ams2", "ams3", + "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", "sfo2", "sfo3", "sgp1", + and "tor1". + "url": "str", # A URL from which the custom Linux virtual machine image may + be retrieved. The image it points to must be in the raw, qcow2, vhdx, vdi, or + vmdk format. It may be compressed using gzip or bzip2 and must be smaller than + 100 GB after being decompressed. Required. + "description": "str", # Optional. An optional free-form text field to + describe an image. + "distribution": "str", # Optional. The name of a custom image's + distribution. Currently, the valid values are ``Arch Linux``"" , ``CentOS``"" , + ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora Atomic``"" , ``FreeBSD``"" + , ``Gentoo``"" , ``openSUSE``"" , ``RancherOS``"" , ``Rocky Linux``"" , + ``Ubuntu``"" , and ``Unknown``. Any other value will be accepted but ignored, + and ``Unknown`` will be used in its place. Known values are: "Arch Linux", + "CentOS", "CoreOS", "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", + "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". + "name": "str", # Optional. The display name that has been given to an image. + This is what is shown in the control panel and is generally a descriptive title + for the image in question. + "tags": [ + "str" # Optional. A flat array of tag names as strings to be applied + to the resource. Tag names may be for either existing or new tags. + ] + } + # response body for status code(s): 202 response == { "image": { @@ -112289,7 +118216,7 @@ def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -112312,7 +118239,7 @@ def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -112330,10 +118257,14 @@ def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112342,38 +118273,41 @@ def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_images_create_custom_request( + _request = build_images_create_custom_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -112393,12 +118327,13 @@ def create_custom(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, image_id: JSON, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Image. To retrieve information about an image, send a ``GET`` request to @@ -112436,7 +118371,7 @@ def get(self, image_id: JSON, **kwargs: Any) -> JSON: Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -112459,7 +118394,7 @@ def get(self, image_id: JSON, **kwargs: Any) -> JSON: associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -112488,10 +118423,14 @@ def get(self, image_id: JSON, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112500,25 +118439,28 @@ def get(self, image_id: JSON, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_images_get_request( + _request = build_images_get_request( image_id=image_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -112555,9 +118497,9 @@ def get(self, image_id: JSON, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update( @@ -112568,6 +118510,7 @@ def update( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update an Image. To update an image, send a ``PUT`` request to ``/v2/images/$IMAGE_ID``. @@ -112624,7 +118567,7 @@ def update( Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -112647,7 +118590,7 @@ def update( associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -112681,11 +118624,12 @@ def update( def update( self, image_id: int, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update an Image. To update an image, send a ``PUT`` request to ``/v2/images/$IMAGE_ID``. @@ -112696,7 +118640,7 @@ def update( Required. :type image_id: int :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -112725,7 +118669,7 @@ def update( Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -112748,7 +118692,7 @@ def update( associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -112779,7 +118723,10 @@ def update( """ @distributed_trace - def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def update( + self, image_id: int, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Update an Image. To update an image, send a ``PUT`` request to ``/v2/images/$IMAGE_ID``. @@ -112789,11 +118736,8 @@ def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: :param image_id: A unique number that can be used to identify and reference a specific image. Required. :type image_id: int - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -112801,6 +118745,23 @@ def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "description": "str", # Optional. An optional free-form text field to + describe an image. + "distribution": "str", # Optional. The name of a custom image's + distribution. Currently, the valid values are ``Arch Linux``"" , ``CentOS``"" , + ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora Atomic``"" , ``FreeBSD``"" + , ``Gentoo``"" , ``openSUSE``"" , ``RancherOS``"" , ``Rocky Linux``"" , + ``Ubuntu``"" , and ``Unknown``. Any other value will be accepted but ignored, + and ``Unknown`` will be used in its place. Known values are: "Arch Linux", + "CentOS", "CoreOS", "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", + "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". + "name": "str" # Optional. The display name that has been given to an image. + This is what is shown in the control panel and is generally a descriptive title + for the image in question. + } + # response body for status code(s): 200 response == { "image": { @@ -112819,7 +118780,7 @@ def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown". "error_message": "str", # Optional. A string containing information - about errors that may occur when importing"n a custom image. + about errors that may occur when importing a custom image. "id": 0, # Optional. A unique number that can be used to identify and reference a specific image. "min_disk_size": 0, # Optional. The minimum disk size in GB required @@ -112842,7 +118803,7 @@ def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id. "status": "str", # Optional. A status string indicating the state of - a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" , + a custom image. This may be ``NEW``"" , ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW", "available", "pending", "deleted", and "retired". "tags": [ @@ -112871,10 +118832,14 @@ def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112883,20 +118848,20 @@ def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_images_update_request( + _request = build_images_update_request( image_id=image_id, content_type=content_type, json=_json, @@ -112904,18 +118869,21 @@ def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -112952,12 +118920,13 @@ def update(self, image_id: int, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, image_id: int, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Image. To delete a snapshot or custom image, send a ``DELETE`` request to ``/v2/images/$IMAGE_ID``. @@ -112984,10 +118953,14 @@ def delete(self, image_id: int, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -112996,25 +118969,28 @@ def delete(self, image_id: int, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_images_delete_request( + _request = build_images_delete_request( image_id=image_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -113047,9 +119023,9 @@ def delete(self, image_id: int, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class ImageActionsOperations: @@ -113073,6 +119049,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, image_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Actions for an Image. To retrieve all actions that have been executed on an image, send a GET request to @@ -113090,6 +119067,9 @@ def list(self, image_id: int, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -113131,9 +119111,6 @@ def list(self, image_id: int, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -113148,10 +119125,14 @@ def list(self, image_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -113160,25 +119141,28 @@ def list(self, image_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_image_actions_list_request( + _request = build_image_actions_list_request( image_id=image_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -113215,9 +119199,9 @@ def list(self, image_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def post( @@ -113228,6 +119212,7 @@ def post( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate an Image Action. The following actions are available on an Image. @@ -113315,11 +119300,12 @@ def post( def post( self, image_id: int, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate an Image Action. The following actions are available on an Image. @@ -113342,7 +119328,7 @@ def post( Required. :type image_id: int :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -113402,8 +119388,12 @@ def post( @distributed_trace def post( - self, image_id: int, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + image_id: int, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate an Image Action. The following actions are available on an Image. @@ -113425,11 +119415,8 @@ def post( :param image_id: A unique number that can be used to identify and reference a specific image. Required. :type image_id: int - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -113437,6 +119424,9 @@ def post( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "completed_at": "2020-02-20 00:00:00", # Optional. A time value given in @@ -113483,10 +119473,14 @@ def post( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -113495,15 +119489,15 @@ def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -113511,7 +119505,7 @@ def post( else: _json = None - request = build_image_actions_post_request( + _request = build_image_actions_post_request( image_id=image_id, content_type=content_type, json=_json, @@ -113519,18 +119513,21 @@ def post( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -113567,12 +119564,13 @@ def post( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, image_id: int, action_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Action. To retrieve the status of an image action, send a GET request to @@ -113637,10 +119635,14 @@ def get(self, image_id: int, action_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -113649,26 +119651,29 @@ def get(self, image_id: int, action_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_image_actions_get_request( + _request = build_image_actions_get_request( image_id=image_id, action_id=action_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -113705,9 +119710,9 @@ def get(self, image_id: int, action_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class KubernetesOperations: # pylint: disable=too-many-public-methods @@ -113733,6 +119738,7 @@ def __init__(self, *args, **kwargs): def list_clusters( self, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Kubernetes Clusters. To list all of the Kubernetes clusters on your account, send a GET request @@ -113751,40 +119757,11 @@ def list_clusters( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "kubernetes_clusters": [ { - "auto_upgrade": False, # Optional. Default value is False. A - boolean value indicating whether the cluster will be automatically - upgraded to new patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP - addresses in the overlay network of the Kubernetes cluster in CIDR - notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time - value given in ISO8601 combined date and time format that represents when - the Kubernetes cluster was created. - "endpoint": "str", # Optional. The base URL of the API - server on the Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean - value indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to - identify and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the - Kubernetes master node. This will not be set if high availability is - configured on the cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance - window policy. May be one of ``monday`` through ``sunday``"" , or - ``any`` to indicate an arbitrary week day. Known values are: "any", - "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", - and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in - UTC of the maintenance window policy in 24-hour clock format / HH:MM - notation (e.g., ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -113869,6 +119846,44 @@ def list_clusters( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), + the latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available + versions. Required. + "auto_upgrade": False, # Optional. Default value is False. A + boolean value indicating whether the cluster will be automatically + upgraded to new patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP + addresses in the overlay network of the Kubernetes cluster in CIDR + notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the Kubernetes cluster was created. + "endpoint": "str", # Optional. The base URL of the API + server on the Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean + value indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to + identify and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the + Kubernetes master node. This will not be set if high availability is + configured on the cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance + window policy. May be one of ``monday`` through ``sunday``"" , or + ``any`` to indicate an arbitrary week day. Known values are: "any", + "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", + and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in + UTC of the maintenance window policy in 24-hour clock format / HH:MM + notation (e.g., ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable @@ -113894,28 +119909,23 @@ def list_clusters( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), - the latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available - versions. Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -113924,26 +119934,29 @@ def list_clusters( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_list_clusters_request( + _request = build_kubernetes_list_clusters_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -113963,14 +119976,15 @@ def list_clusters( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_cluster( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Kubernetes Cluster. To create a new Kubernetes cluster, send a POST request to @@ -113997,36 +120011,6 @@ def create_cluster( # JSON input template you can fill out and use as your body input. body = { - "auto_upgrade": False, # Optional. Default value is False. A boolean value - indicating whether the cluster will be automatically upgraded to new patch - releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in the - overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given in - ISO8601 combined date and time format that represents when the Kubernetes cluster - was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value indicating - whether the control plane is run in a highly available configuration in the - cluster. Highly available control planes incur less downtime. The property cannot - be disabled. - "id": "str", # Optional. A unique ID that can be used to identify and - reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes master - node. This will not be set if high availability is configured on the cluster - (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window policy. - May be one of ``monday`` through ``sunday``"" , or ``any`` to indicate an - arbitrary week day. Known values are: "any", "monday", "tuesday", - "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the maintenance - window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ { @@ -114100,6 +120084,41 @@ def create_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of Kubernetes used + for the cluster. If set to a minor version (e.g. "1.14"), the latest version + within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest + published version will be used. See the ``/v2/kubernetes/options`` endpoint to + find all currently available versions. Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether the cluster will be automatically upgraded to new patch + releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in the + overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the Kubernetes cluster + was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value indicating + whether the control plane is run in a highly available configuration in the + cluster. Highly available control planes incur less downtime. The property cannot + be disabled. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes master + node. This will not be set if high availability is configured on the cluster + (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window policy. + May be one of ``monday`` through ``sunday``"" , or ``any`` to indicate an + arbitrary week day. Known values are: "any", "monday", "tuesday", + "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the maintenance + window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP addresses @@ -114123,11 +120142,6 @@ def create_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of Kubernetes used - for the cluster. If set to a minor version (e.g. "1.14"), the latest version - within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest - published version will be used. See the ``/v2/kubernetes/options`` endpoint to - find all currently available versions. Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -114135,36 +120149,6 @@ def create_cluster( # response body for status code(s): 201 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -114243,6 +120227,42 @@ def create_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -114266,12 +120286,6 @@ def create_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -114280,8 +120294,9 @@ def create_cluster( @overload def create_cluster( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Kubernetes Cluster. To create a new Kubernetes cluster, send a POST request to @@ -114295,7 +120310,7 @@ def create_cluster( for details. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -114309,36 +120324,6 @@ def create_cluster( # response body for status code(s): 201 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -114417,6 +120402,42 @@ def create_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -114440,12 +120461,6 @@ def create_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -114453,7 +120468,8 @@ def create_cluster( """ @distributed_trace - def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Kubernetes Cluster. To create a new Kubernetes cluster, send a POST request to @@ -114466,11 +120482,8 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: `here `_ for details. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -114478,39 +120491,146 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A human-readable name for a Kubernetes cluster. Required. + "node_pools": [ + { + "auto_scale": bool, # Optional. A boolean value indicating + whether auto-scaling is enabled for this node pool. + "count": 0, # Optional. The number of Droplet instances in + the node pool. + "id": "str", # Optional. A unique ID that can be used to + identify and reference a specific node pool. + "labels": {}, # Optional. An object of key/value mappings + specifying labels to apply to all nodes in a pool. Labels will + automatically be applied to all existing nodes and any subsequent nodes + added to the pool. Note that when a label is removed, it is not deleted + from the nodes in the pool. + "max_nodes": 0, # Optional. The maximum number of nodes that + this node pool can be auto-scaled to. The value will be ``0`` if + ``auto_scale`` is set to ``false``. + "min_nodes": 0, # Optional. The minimum number of nodes that + this node pool can be auto-scaled to. The value will be ``0`` if + ``auto_scale`` is set to ``false``. + "name": "str", # Optional. A human-readable name for the + node pool. + "nodes": [ + { + "created_at": "2020-02-20 00:00:00", # + Optional. A time value given in ISO8601 combined date and time + format that represents when the node was created. + "droplet_id": "str", # Optional. The ID of + the Droplet used for the worker node. + "id": "str", # Optional. A unique ID that + can be used to identify and reference the node. + "name": "str", # Optional. An automatically + generated, human-readable name for the node. + "status": { + "state": "str" # Optional. A string + indicating the current status of the node. Known values are: + "provisioning", "running", "draining", and "deleting". + }, + "updated_at": "2020-02-20 00:00:00" # + Optional. A time value given in ISO8601 combined date and time + format that represents when the node was last updated. + } + ], + "size": "str", # Optional. The slug identifier for the type + of Droplet used as workers in the node pool. + "tags": [ + "str" # Optional. An array containing the tags + applied to the node pool. All node pools are automatically tagged + ``k8s``"" , ``k8s-worker``"" , and ``k8s:$K8S_CLUSTER_ID``. + ], + "taints": [ + { + "effect": "str", # Optional. How the node + reacts to pods that it won't tolerate. Available effect values + are ``NoSchedule``"" , ``PreferNoSchedule``"" , and + ``NoExecute``. Known values are: "NoSchedule", + "PreferNoSchedule", and "NoExecute". + "key": "str", # Optional. An arbitrary + string. The ``key`` and ``value`` fields of the ``taint`` object + form a key-value pair. For example, if the value of the ``key`` + field is "special" and the value of the ``value`` field is "gpu", + the key value pair would be ``special=gpu``. + "value": "str" # Optional. An arbitrary + string. The ``key`` and ``value`` fields of the ``taint`` object + form a key-value pair. For example, if the value of the ``key`` + field is "special" and the value of the ``value`` field is "gpu", + the key value pair would be ``special=gpu``. + } + ] + } + ], + "region": "str", # The slug identifier for the region where the Kubernetes + cluster is located. Required. + "version": "str", # The slug identifier for the version of Kubernetes used + for the cluster. If set to a minor version (e.g. "1.14"), the latest version + within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest + published version will be used. See the ``/v2/kubernetes/options`` endpoint to + find all currently available versions. Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether the cluster will be automatically upgraded to new patch + releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in the + overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the Kubernetes cluster + was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value indicating + whether the control plane is run in a highly available configuration in the + cluster. Highly available control planes incur less downtime. The property cannot + be disabled. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes master + node. This will not be set if high availability is configured on the cluster + (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window policy. + May be one of ``monday`` through ``sunday``"" , or ``any`` to indicate an + arbitrary week day. Known values are: "any", "monday", "tuesday", + "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the maintenance + window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, + "registry_enabled": bool, # Optional. A read-only boolean value indicating + if a container registry is integrated with the cluster. + "service_subnet": "str", # Optional. The range of assignable IP addresses + for services running in the Kubernetes cluster in CIDR notation. + "status": { + "message": "str", # Optional. An optional message providing + additional information about the current cluster state. + "state": "str" # Optional. A string indicating the current status of + the cluster. Known values are: "running", "provisioning", "degraded", + "error", "deleted", "upgrading", and "deleting". + }, + "surge_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether surge upgrade is enabled/disabled for the cluster. Surge + upgrade makes cluster upgrades fast and reliable by bringing up new nodes before + destroying the outdated nodes. + "tags": [ + "str" # Optional. An array of tags applied to the Kubernetes + cluster. All clusters are automatically tagged ``k8s`` and + ``k8s:$K8S_CLUSTER_ID``. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the Kubernetes cluster + was last updated. + "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to + which the Kubernetes cluster is assigned. + } + # response body for status code(s): 201 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -114589,6 +120709,42 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -114612,21 +120768,19 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -114635,38 +120789,41 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_create_cluster_request( + _request = build_kubernetes_create_cluster_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -114686,12 +120843,13 @@ def create_cluster(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Kubernetes Cluster. To show information about an existing Kubernetes cluster, send a GET request @@ -114709,36 +120867,6 @@ def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -114817,6 +120945,42 @@ def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -114840,12 +121004,6 @@ def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -114862,10 +121020,14 @@ def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -114874,25 +121036,28 @@ def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_cluster_request( + _request = build_kubernetes_get_cluster_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -114929,9 +121094,9 @@ def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_cluster( @@ -114942,6 +121107,7 @@ def update_cluster( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Kubernetes Cluster. To update a Kubernetes cluster, send a PUT request to @@ -114964,6 +121130,7 @@ def update_cluster( # JSON input template you can fill out and use as your body input. body = { + "name": "str", # A human-readable name for a Kubernetes cluster. Required. "auto_upgrade": False, # Optional. Default value is False. A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window. @@ -114982,7 +121149,6 @@ def update_cluster( maintenance window policy in 24-hour clock format / HH:MM notation (e.g., ``15:00``"" ). }, - "name": "str", # A human-readable name for a Kubernetes cluster. Required. "surge_upgrade": False, # Optional. Default value is False. A boolean value indicating whether surge upgrade is enabled/disabled for the cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing up new nodes before @@ -114997,36 +121163,6 @@ def update_cluster( # response body for status code(s): 202 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -115105,6 +121241,42 @@ def update_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -115128,12 +121300,6 @@ def update_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -115155,11 +121321,12 @@ def update_cluster( def update_cluster( self, cluster_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Kubernetes Cluster. To update a Kubernetes cluster, send a PUT request to @@ -115169,7 +121336,7 @@ def update_cluster( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -115183,36 +121350,6 @@ def update_cluster( # response body for status code(s): 202 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -115291,6 +121428,42 @@ def update_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -115314,12 +121487,6 @@ def update_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -115339,8 +121506,9 @@ def update_cluster( @distributed_trace def update_cluster( - self, cluster_id: str, body: Union[JSON, IO], **kwargs: Any + self, cluster_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update a Kubernetes Cluster. To update a Kubernetes cluster, send a PUT request to @@ -115349,11 +121517,8 @@ def update_cluster( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -115361,39 +121526,41 @@ def update_cluster( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A human-readable name for a Kubernetes cluster. Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether the cluster will be automatically upgraded to new patch + releases during its maintenance window. + "ha": False, # Optional. Default value is False. A boolean value indicating + whether the control plane is run in a highly available configuration in the + cluster. Highly available control planes incur less downtime. The property cannot + be disabled. + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window policy. + May be one of ``monday`` through ``sunday``"" , or ``any`` to indicate an + arbitrary week day. Known values are: "any", "monday", "tuesday", + "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the maintenance + window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, + "surge_upgrade": False, # Optional. Default value is False. A boolean value + indicating whether surge upgrade is enabled/disabled for the cluster. Surge + upgrade makes cluster upgrades fast and reliable by bringing up new nodes before + destroying the outdated nodes. + "tags": [ + "str" # Optional. An array of tags applied to the Kubernetes + cluster. All clusters are automatically tagged ``k8s`` and + ``k8s:$K8S_CLUSTER_ID``. + ] + } + # response body for status code(s): 202 response == { "kubernetes_cluster": { - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_subnet": "str", # Optional. The range of IP addresses in - the overlay network of the Kubernetes cluster in CIDR notation. - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": False, # Optional. Default value is False. A boolean value - indicating whether the control plane is run in a highly available - configuration in the cluster. Highly available control planes incur less - downtime. The property cannot be disabled. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, "name": "str", # A human-readable name for a Kubernetes cluster. Required. "node_pools": [ @@ -115472,6 +121639,42 @@ def update_cluster( ], "region": "str", # The slug identifier for the region where the Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_subnet": "str", # Optional. The range of IP addresses in + the overlay network of the Kubernetes cluster in CIDR notation. + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": False, # Optional. Default value is False. A boolean value + indicating whether the control plane is run in a highly available + configuration in the cluster. Highly available control planes incur less + downtime. The property cannot be disabled. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, "registry_enabled": bool, # Optional. A read-only boolean value indicating if a container registry is integrated with the cluster. "service_subnet": "str", # Optional. The range of assignable IP @@ -115495,12 +121698,6 @@ def update_cluster( "updated_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. } @@ -115517,10 +121714,14 @@ def update_cluster( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -115529,20 +121730,20 @@ def update_cluster( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_update_cluster_request( + _request = build_kubernetes_update_cluster_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -115550,18 +121751,21 @@ def update_cluster( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -115598,12 +121802,13 @@ def update_cluster( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_cluster(self, cluster_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Kubernetes Cluster. To delete a Kubernetes cluster and all services deployed to it, send a DELETE @@ -115633,10 +121838,14 @@ def delete_cluster(self, cluster_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -115645,25 +121854,28 @@ def delete_cluster(self, cluster_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_delete_cluster_request( + _request = build_kubernetes_delete_cluster_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -115696,12 +121908,13 @@ def delete_cluster(self, cluster_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_associated_resources(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Associated Resources for Cluster Deletion. To list the associated billable resources that can be destroyed along with a cluster, send a @@ -115756,10 +121969,14 @@ def list_associated_resources(self, cluster_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -115768,25 +121985,28 @@ def list_associated_resources(self, cluster_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_list_associated_resources_request( + _request = build_kubernetes_list_associated_resources_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -115823,9 +122043,9 @@ def list_associated_resources(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def destroy_associated_resources_selective( @@ -115836,13 +122056,14 @@ def destroy_associated_resources_selective( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Delete a Cluster and its Associated Resources. To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective``. - The JSON body of the request should include ``load_balancers``\ , ``volumes``\ , or + The JSON body of the request should include ``load_balancers``\\ , ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. @@ -115897,18 +122118,19 @@ def destroy_associated_resources_selective( def destroy_associated_resources_selective( self, cluster_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Delete a Cluster and its Associated Resources. To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective``. - The JSON body of the request should include ``load_balancers``\ , ``volumes``\ , or + The JSON body of the request should include ``load_balancers``\\ , ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. @@ -115919,7 +122141,7 @@ def destroy_associated_resources_selective( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -115945,15 +122167,16 @@ def destroy_associated_resources_selective( @distributed_trace def destroy_associated_resources_selective( - self, cluster_id: str, body: Union[JSON, IO], **kwargs: Any + self, cluster_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Selectively Delete a Cluster and its Associated Resources. To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective``. - The JSON body of the request should include ``load_balancers``\ , ``volumes``\ , or + The JSON body of the request should include ``load_balancers``\\ , ``volumes``\\ , or ``volume_snapshots`` keys each set to an array of IDs for the associated resources to be destroyed. @@ -115963,11 +122186,8 @@ def destroy_associated_resources_selective( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -115975,6 +122195,22 @@ def destroy_associated_resources_selective( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "load_balancers": [ + "str" # Optional. A list of IDs for associated load balancers to + destroy along with the cluster. + ], + "volume_snapshots": [ + "str" # Optional. A list of IDs for associated volume snapshots to + destroy along with the cluster. + ], + "volumes": [ + "str" # Optional. A list of IDs for associated volumes to destroy + along with the cluster. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -115987,10 +122223,14 @@ def destroy_associated_resources_selective( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -115999,20 +122239,20 @@ def destroy_associated_resources_selective( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_destroy_associated_resources_selective_request( + _request = build_kubernetes_destroy_associated_resources_selective_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -116020,18 +122260,21 @@ def destroy_associated_resources_selective( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -116064,14 +122307,15 @@ def destroy_associated_resources_selective( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def destroy_associated_resources_dangerous( self, cluster_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Cluster and All of its Associated Resources (Dangerous). To delete a Kubernetes cluster with all of its associated resources, send a @@ -116100,10 +122344,14 @@ def destroy_associated_resources_dangerous( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116112,25 +122360,28 @@ def destroy_associated_resources_dangerous( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_destroy_associated_resources_dangerous_request( + _request = build_kubernetes_destroy_associated_resources_dangerous_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -116163,25 +122414,26 @@ def destroy_associated_resources_dangerous( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_kubeconfig( self, cluster_id: str, *, expiry_seconds: int = 0, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Retrieve the kubeconfig for a Kubernetes Cluster. This endpoint returns a kubeconfig file in YAML format. It can be used to connect to and administer the cluster using the Kubernetes command line tool, - ``kubectl``\ , or other programs supporting kubeconfig files (e.g., client libraries). + ``kubectl``\\ , or other programs supporting kubeconfig files (e.g., client libraries). The resulting kubeconfig file uses token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of - supported versions and more information, see "\ `How to Connect to a DigitalOcean + supported versions and more information, see "\\ `How to Connect to a DigitalOcean Kubernetes Cluster with kubectl - `_\ ". + `_\\ ". To retrieve a kubeconfig file for use with a Kubernetes cluster, send a GET request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig``. @@ -116216,10 +122468,14 @@ def get_kubeconfig( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116228,26 +122484,29 @@ def get_kubeconfig( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_get_kubeconfig_request( + _request = build_kubernetes_get_kubeconfig_request( cluster_id=cluster_id, expiry_seconds=expiry_seconds, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -116280,14 +122539,15 @@ def get_kubeconfig( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_credentials( self, cluster_id: str, *, expiry_seconds: int = 0, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Retrieve Credentials for a Kubernetes Cluster. This endpoint returns a JSON object . It can be used to programmatically @@ -116295,9 +122555,9 @@ def get_credentials( The resulting JSON object contains token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of - supported versions and more information, see "\ `How to Connect to a DigitalOcean + supported versions and more information, see "\\ `How to Connect to a DigitalOcean Kubernetes Cluster with kubectl - `_\ ". + `_\\ ". To retrieve credentials for accessing a Kubernetes cluster, send a GET request to ``/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials``. @@ -116326,17 +122586,16 @@ def get_credentials( A base64 encoding of bytes representing the certificate authority data for accessing the cluster. "client_certificate_data": bytes("bytes", encoding="utf-8"), # Optional. A - base64 encoding of bytes representing the x509 client"ncertificate data for - access the cluster. This is only returned for clusters"nwithout support for - token-based authentication."n"nNewly created Kubernetes clusters do not return - credentials using"ncertificate-based authentication. For additional - information,"n`see here + base64 encoding of bytes representing the x509 client certificate data for access + the cluster. This is only returned for clusters without support for token-based + authentication. Newly created Kubernetes clusters do not return credentials + using certificate-based authentication. For additional information, `see here `_. "client_key_data": bytes("bytes", encoding="utf-8"), # Optional. A base64 - encoding of bytes representing the x509 client key"ndata for access the cluster. - This is only returned for clusters without"nsupport for token-based - authentication."n"nNewly created Kubernetes clusters do not return credentials - using"ncertificate-based authentication. For additional information,"n`see here + encoding of bytes representing the x509 client key data for access the cluster. + This is only returned for clusters without support for token-based + authentication. Newly created Kubernetes clusters do not return credentials + using certificate-based authentication. For additional information, `see here `_. "expires_at": "2020-02-20 00:00:00", # Optional. A time value given in ISO8601 combined date and time format that represents when the access token @@ -116358,10 +122617,14 @@ def get_credentials( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116370,26 +122633,29 @@ def get_credentials( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_credentials_request( + _request = build_kubernetes_get_credentials_request( cluster_id=cluster_id, expiry_seconds=expiry_seconds, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -116426,12 +122692,13 @@ def get_credentials( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_available_upgrades(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve Available Upgrades for an Existing Kubernetes Cluster. To determine whether a cluster can be upgraded, and the versions to which it @@ -116476,10 +122743,14 @@ def get_available_upgrades(self, cluster_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116488,25 +122759,28 @@ def get_available_upgrades(self, cluster_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_available_upgrades_request( + _request = build_kubernetes_get_available_upgrades_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -116543,9 +122817,9 @@ def get_available_upgrades(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def upgrade_cluster( @@ -116556,6 +122830,7 @@ def upgrade_cluster( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade a Kubernetes Cluster. To immediately upgrade a Kubernetes cluster to a newer patch release of @@ -116602,11 +122877,12 @@ def upgrade_cluster( def upgrade_cluster( self, cluster_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade a Kubernetes Cluster. To immediately upgrade a Kubernetes cluster to a newer patch release of @@ -116619,7 +122895,7 @@ def upgrade_cluster( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -116645,8 +122921,9 @@ def upgrade_cluster( @distributed_trace def upgrade_cluster( - self, cluster_id: str, body: Union[JSON, IO], **kwargs: Any + self, cluster_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Upgrade a Kubernetes Cluster. To immediately upgrade a Kubernetes cluster to a newer patch release of @@ -116658,11 +122935,8 @@ def upgrade_cluster( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -116670,6 +122944,12 @@ def upgrade_cluster( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "version": "str" # Optional. The slug identifier for the version of + Kubernetes that the cluster will be upgraded to. + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -116682,10 +122962,14 @@ def upgrade_cluster( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116694,20 +122978,20 @@ def upgrade_cluster( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_upgrade_cluster_request( + _request = build_kubernetes_upgrade_cluster_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -116715,18 +122999,21 @@ def upgrade_cluster( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -116759,12 +123046,13 @@ def upgrade_cluster( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_node_pools(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Node Pools in a Kubernetes Clusters. To list all of the node pools in a Kubernetes clusters, send a GET request to @@ -116864,10 +123152,14 @@ def list_node_pools(self, cluster_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -116876,25 +123168,28 @@ def list_node_pools(self, cluster_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_list_node_pools_request( + _request = build_kubernetes_list_node_pools_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -116931,9 +123226,9 @@ def list_node_pools(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def add_node_pool( @@ -116944,6 +123239,7 @@ def add_node_pool( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Add a Node Pool to a Kubernetes Cluster. To add an additional node pool to a Kubernetes clusters, send a POST request @@ -117115,11 +123411,12 @@ def add_node_pool( def add_node_pool( self, cluster_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Add a Node Pool to a Kubernetes Cluster. To add an additional node pool to a Kubernetes clusters, send a POST request @@ -117129,7 +123426,7 @@ def add_node_pool( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -117223,8 +123520,9 @@ def add_node_pool( @distributed_trace def add_node_pool( - self, cluster_id: str, body: Union[JSON, IO], **kwargs: Any + self, cluster_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Add a Node Pool to a Kubernetes Cluster. To add an additional node pool to a Kubernetes clusters, send a POST request @@ -117233,11 +123531,8 @@ def add_node_pool( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -117245,6 +123540,72 @@ def add_node_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "auto_scale": bool, # Optional. A boolean value indicating whether + auto-scaling is enabled for this node pool. + "count": 0, # Optional. The number of Droplet instances in the node pool. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a specific node pool. + "labels": {}, # Optional. An object of key/value mappings specifying labels + to apply to all nodes in a pool. Labels will automatically be applied to all + existing nodes and any subsequent nodes added to the pool. Note that when a label + is removed, it is not deleted from the nodes in the pool. + "max_nodes": 0, # Optional. The maximum number of nodes that this node pool + can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is set to + ``false``. + "min_nodes": 0, # Optional. The minimum number of nodes that this node pool + can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is set to + ``false``. + "name": "str", # Optional. A human-readable name for the node pool. + "nodes": [ + { + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the node was created. + "droplet_id": "str", # Optional. The ID of the Droplet used + for the worker node. + "id": "str", # Optional. A unique ID that can be used to + identify and reference the node. + "name": "str", # Optional. An automatically generated, + human-readable name for the node. + "status": { + "state": "str" # Optional. A string indicating the + current status of the node. Known values are: "provisioning", + "running", "draining", and "deleting". + }, + "updated_at": "2020-02-20 00:00:00" # Optional. A time value + given in ISO8601 combined date and time format that represents when the + node was last updated. + } + ], + "size": "str", # Optional. The slug identifier for the type of Droplet used + as workers in the node pool. + "tags": [ + "str" # Optional. An array containing the tags applied to the node + pool. All node pools are automatically tagged ``k8s``"" , ``k8s-worker``"" , + and ``k8s:$K8S_CLUSTER_ID``. + ], + "taints": [ + { + "effect": "str", # Optional. How the node reacts to pods + that it won't tolerate. Available effect values are ``NoSchedule``"" , + ``PreferNoSchedule``"" , and ``NoExecute``. Known values are: + "NoSchedule", "PreferNoSchedule", and "NoExecute". + "key": "str", # Optional. An arbitrary string. The ``key`` + and ``value`` fields of the ``taint`` object form a key-value pair. For + example, if the value of the ``key`` field is "special" and the value of + the ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + "value": "str" # Optional. An arbitrary string. The ``key`` + and ``value`` fields of the ``taint`` object form a key-value pair. For + example, if the value of the ``key`` field is "special" and the value of + the ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + } + ] + } + # response body for status code(s): 201 response == { "node_pool": { @@ -117325,10 +123686,14 @@ def add_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117337,20 +123702,20 @@ def add_node_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_add_node_pool_request( + _request = build_kubernetes_add_node_pool_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -117358,18 +123723,21 @@ def add_node_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117406,12 +123774,13 @@ def add_node_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_node_pool(self, cluster_id: str, node_pool_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve a Node Pool for a Kubernetes Cluster. To show information about a specific node pool in a Kubernetes cluster, send @@ -117509,10 +123878,14 @@ def get_node_pool(self, cluster_id: str, node_pool_id: str, **kwargs: Any) -> JS tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117521,26 +123894,29 @@ def get_node_pool(self, cluster_id: str, node_pool_id: str, **kwargs: Any) -> JS _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_node_pool_request( + _request = build_kubernetes_get_node_pool_request( cluster_id=cluster_id, node_pool_id=node_pool_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -117577,9 +123953,9 @@ def get_node_pool(self, cluster_id: str, node_pool_id: str, **kwargs: Any) -> JS deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_node_pool( @@ -117591,6 +123967,7 @@ def update_node_pool( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Node Pool in a Kubernetes Cluster. To update the name of a node pool, edit the tags applied to it, or adjust its @@ -117765,11 +124142,12 @@ def update_node_pool( self, cluster_id: str, node_pool_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Node Pool in a Kubernetes Cluster. To update the name of a node pool, edit the tags applied to it, or adjust its @@ -117783,7 +124161,7 @@ def update_node_pool( Required. :type node_pool_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -117877,8 +124255,13 @@ def update_node_pool( @distributed_trace def update_node_pool( - self, cluster_id: str, node_pool_id: str, body: Union[JSON, IO], **kwargs: Any + self, + cluster_id: str, + node_pool_id: str, + body: Union[JSON, IO[bytes]], + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Node Pool in a Kubernetes Cluster. To update the name of a node pool, edit the tags applied to it, or adjust its @@ -117891,11 +124274,8 @@ def update_node_pool( :param node_pool_id: A unique ID that can be used to reference a Kubernetes node pool. Required. :type node_pool_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -117903,6 +124283,70 @@ def update_node_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "auto_scale": bool, # Optional. A boolean value indicating whether + auto-scaling is enabled for this node pool. + "count": 0, # Optional. The number of Droplet instances in the node pool. + "id": "str", # Optional. A unique ID that can be used to identify and + reference a specific node pool. + "labels": {}, # Optional. An object of key/value mappings specifying labels + to apply to all nodes in a pool. Labels will automatically be applied to all + existing nodes and any subsequent nodes added to the pool. Note that when a label + is removed, it is not deleted from the nodes in the pool. + "max_nodes": 0, # Optional. The maximum number of nodes that this node pool + can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is set to + ``false``. + "min_nodes": 0, # Optional. The minimum number of nodes that this node pool + can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is set to + ``false``. + "name": "str", # Optional. A human-readable name for the node pool. + "nodes": [ + { + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the node was created. + "droplet_id": "str", # Optional. The ID of the Droplet used + for the worker node. + "id": "str", # Optional. A unique ID that can be used to + identify and reference the node. + "name": "str", # Optional. An automatically generated, + human-readable name for the node. + "status": { + "state": "str" # Optional. A string indicating the + current status of the node. Known values are: "provisioning", + "running", "draining", and "deleting". + }, + "updated_at": "2020-02-20 00:00:00" # Optional. A time value + given in ISO8601 combined date and time format that represents when the + node was last updated. + } + ], + "tags": [ + "str" # Optional. An array containing the tags applied to the node + pool. All node pools are automatically tagged ``k8s``"" , ``k8s-worker``"" , + and ``k8s:$K8S_CLUSTER_ID``. + ], + "taints": [ + { + "effect": "str", # Optional. How the node reacts to pods + that it won't tolerate. Available effect values are ``NoSchedule``"" , + ``PreferNoSchedule``"" , and ``NoExecute``. Known values are: + "NoSchedule", "PreferNoSchedule", and "NoExecute". + "key": "str", # Optional. An arbitrary string. The ``key`` + and ``value`` fields of the ``taint`` object form a key-value pair. For + example, if the value of the ``key`` field is "special" and the value of + the ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + "value": "str" # Optional. An arbitrary string. The ``key`` + and ``value`` fields of the ``taint`` object form a key-value pair. For + example, if the value of the ``key`` field is "special" and the value of + the ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + } + ] + } + # response body for status code(s): 202 response == { "node_pool": { @@ -117983,10 +124427,14 @@ def update_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -117995,20 +124443,20 @@ def update_node_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_update_node_pool_request( + _request = build_kubernetes_update_node_pool_request( cluster_id=cluster_id, node_pool_id=node_pool_id, content_type=content_type, @@ -118017,18 +124465,21 @@ def update_node_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118065,14 +124516,15 @@ def update_node_pool( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_node_pool( self, cluster_id: str, node_pool_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Node Pool in a Kubernetes Cluster. To delete a node pool, send a DELETE request to @@ -118105,10 +124557,14 @@ def delete_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118117,26 +124573,29 @@ def delete_node_pool( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_delete_node_pool_request( + _request = build_kubernetes_delete_node_pool_request( cluster_id=cluster_id, node_pool_id=node_pool_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -118169,9 +124628,9 @@ def delete_node_pool( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def delete_node( @@ -118184,6 +124643,7 @@ def delete_node( replace: int = 0, **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Node in a Kubernetes Cluster. To delete a single node in a pool, send a DELETE request to @@ -118232,10 +124692,14 @@ def delete_node( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118244,9 +124708,9 @@ def delete_node( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_kubernetes_delete_node_request( + _request = build_kubernetes_delete_node_request( cluster_id=cluster_id, node_pool_id=node_pool_id, node_id=node_id, @@ -118255,18 +124719,21 @@ def delete_node( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -118299,9 +124766,9 @@ def delete_node( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def recycle_node_pool( @@ -118313,6 +124780,7 @@ def recycle_node_pool( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Recycle a Kubernetes Node Pool. The endpoint has been deprecated. Please use the DELETE @@ -118361,11 +124829,12 @@ def recycle_node_pool( self, cluster_id: str, node_pool_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Recycle a Kubernetes Node Pool. The endpoint has been deprecated. Please use the DELETE @@ -118378,7 +124847,7 @@ def recycle_node_pool( Required. :type node_pool_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -118404,8 +124873,13 @@ def recycle_node_pool( @distributed_trace def recycle_node_pool( - self, cluster_id: str, node_pool_id: str, body: Union[JSON, IO], **kwargs: Any + self, + cluster_id: str, + node_pool_id: str, + body: Union[JSON, IO[bytes]], + **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Recycle a Kubernetes Node Pool. The endpoint has been deprecated. Please use the DELETE @@ -118417,11 +124891,8 @@ def recycle_node_pool( :param node_pool_id: A unique ID that can be used to reference a Kubernetes node pool. Required. :type node_pool_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -118429,6 +124900,13 @@ def recycle_node_pool( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "nodes": [ + "str" # Optional. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -118441,10 +124919,14 @@ def recycle_node_pool( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118453,20 +124935,20 @@ def recycle_node_pool( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_kubernetes_recycle_node_pool_request( + _request = build_kubernetes_recycle_node_pool_request( cluster_id=cluster_id, node_pool_id=node_pool_id, content_type=content_type, @@ -118475,18 +124957,21 @@ def recycle_node_pool( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -118519,12 +125004,13 @@ def recycle_node_pool( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_cluster_user(self, cluster_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve User Information for a Kubernetes Cluster. To show information the user associated with a Kubernetes cluster, send a GET @@ -118562,10 +125048,14 @@ def get_cluster_user(self, cluster_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118574,25 +125064,28 @@ def get_cluster_user(self, cluster_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_cluster_user_request( + _request = build_kubernetes_get_cluster_user_request( cluster_id=cluster_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118629,12 +125122,13 @@ def get_cluster_user(self, cluster_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_options(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Available Regions, Node Sizes, and Versions of Kubernetes. To list the versions of Kubernetes available for use, the regions that support Kubernetes, and @@ -118695,10 +125189,14 @@ def list_options(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118707,24 +125205,27 @@ def list_options(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_list_options_request( + _request = build_kubernetes_list_options_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -118761,9 +125262,9 @@ def list_options(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def run_cluster_lint( @@ -118774,6 +125275,7 @@ def run_cluster_lint( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Run Clusterlint Checks on a Kubernetes Cluster. Clusterlint helps operators conform to Kubernetes best practices around @@ -118845,11 +125347,12 @@ def run_cluster_lint( def run_cluster_lint( self, cluster_id: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Run Clusterlint Checks on a Kubernetes Cluster. Clusterlint helps operators conform to Kubernetes best practices around @@ -118868,7 +125371,7 @@ def run_cluster_lint( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -118899,8 +125402,12 @@ def run_cluster_lint( @distributed_trace def run_cluster_lint( - self, cluster_id: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + cluster_id: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Run Clusterlint Checks on a Kubernetes Cluster. Clusterlint helps operators conform to Kubernetes best practices around @@ -118918,11 +125425,8 @@ def run_cluster_lint( :param cluster_id: A unique ID that can be used to reference a Kubernetes cluster. Required. :type cluster_id: str - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -118930,6 +125434,26 @@ def run_cluster_lint( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "exclude_checks": [ + "str" # Optional. An array of checks that will be run when + clusterlint executes checks. + ], + "exclude_groups": [ + "str" # Optional. An array of check groups that will be omitted when + clusterlint executes checks. + ], + "include_checks": [ + "str" # Optional. An array of checks that will be run when + clusterlint executes checks. + ], + "include_groups": [ + "str" # Optional. An array of check groups that will be run when + clusterlint executes checks. + ] + } + # response body for status code(s): 202 response == { "run_id": "str" # Optional. ID of the clusterlint run that can be used later @@ -118947,10 +125471,14 @@ def run_cluster_lint( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -118959,15 +125487,15 @@ def run_cluster_lint( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -118975,7 +125503,7 @@ def run_cluster_lint( else: _json = None - request = build_kubernetes_run_cluster_lint_request( + _request = build_kubernetes_run_cluster_lint_request( cluster_id=cluster_id, content_type=content_type, json=_json, @@ -118983,18 +125511,21 @@ def run_cluster_lint( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -119031,14 +125562,15 @@ def run_cluster_lint( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_cluster_lint_results( self, cluster_id: str, *, run_id: Optional[str] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Fetch Clusterlint Diagnostics for a Kubernetes Cluster. To request clusterlint diagnostics for your cluster, send a GET request to @@ -119102,10 +125634,14 @@ def get_cluster_lint_results( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -119114,26 +125650,29 @@ def get_cluster_lint_results( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_kubernetes_get_cluster_lint_results_request( + _request = build_kubernetes_get_cluster_lint_results_request( cluster_id=cluster_id, run_id=run_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -119170,9 +125709,9 @@ def get_cluster_lint_results( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def add_registry( # pylint: disable=inconsistent-return-statements @@ -119211,7 +125750,7 @@ def add_registry( # pylint: disable=inconsistent-return-statements @overload def add_registry( # pylint: disable=inconsistent-return-statements self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, @@ -119222,7 +125761,7 @@ def add_registry( # pylint: disable=inconsistent-return-statements ``/v2/kubernetes/registry``. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -119233,26 +125772,38 @@ def add_registry( # pylint: disable=inconsistent-return-statements @distributed_trace def add_registry( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """Add Container Registry to Kubernetes Clusters. To integrate the container registry with Kubernetes clusters, send a POST request to ``/v2/kubernetes/registry``. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "cluster_uuids": [ + "str" # Optional. An array containing the UUIDs of Kubernetes + clusters. + ] + } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -119261,15 +125812,15 @@ def add_registry( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -119277,25 +125828,28 @@ def add_registry( # pylint: disable=inconsistent-return-statements else: _json = None - request = build_kubernetes_add_registry_request( + _request = build_kubernetes_add_registry_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -119310,7 +125864,7 @@ def add_registry( # pylint: disable=inconsistent-return-statements ) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) # type: ignore @overload def remove_registry( # pylint: disable=inconsistent-return-statements @@ -119349,7 +125903,7 @@ def remove_registry( # pylint: disable=inconsistent-return-statements @overload def remove_registry( # pylint: disable=inconsistent-return-statements self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, @@ -119360,7 +125914,7 @@ def remove_registry( # pylint: disable=inconsistent-return-statements ``/v2/kubernetes/registry``. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -119371,26 +125925,38 @@ def remove_registry( # pylint: disable=inconsistent-return-statements @distributed_trace def remove_registry( # pylint: disable=inconsistent-return-statements - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: """Remove Container Registry from Kubernetes Clusters. To remove the container registry from Kubernetes clusters, send a DELETE request to ``/v2/kubernetes/registry``. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "cluster_uuids": [ + "str" # Optional. An array containing the UUIDs of Kubernetes + clusters. + ] + } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -119399,15 +125965,15 @@ def remove_registry( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -119415,25 +125981,28 @@ def remove_registry( # pylint: disable=inconsistent-return-statements else: _json = None - request = build_kubernetes_remove_registry_request( + _request = build_kubernetes_remove_registry_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -119448,7 +126017,7 @@ def remove_registry( # pylint: disable=inconsistent-return-statements ) if cls: - return cls(pipeline_response, None, response_headers) + return cls(pipeline_response, None, response_headers) # type: ignore class LoadBalancersOperations: @@ -119474,6 +126043,7 @@ def __init__(self, *args, **kwargs): def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Load Balancer. To create a new load balancer instance, send a POST request to @@ -119508,35 +126078,8 @@ def create( # response body for status code(s): 202 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -119558,11 +126101,38 @@ def create( balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -119605,8 +126175,8 @@ def create( "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -119641,8 +126211,9 @@ def create( @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Load Balancer. To create a new load balancer instance, send a POST request to @@ -119660,7 +126231,7 @@ def create( These methods are mutually exclusive. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -119674,35 +126245,8 @@ def create( # response body for status code(s): 202 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -119724,11 +126268,38 @@ def create( balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -119771,8 +126342,8 @@ def create( "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -119806,7 +126377,8 @@ def create( """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Load Balancer. To create a new load balancer instance, send a POST request to @@ -119823,11 +126395,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: These methods are mutually exclusive. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -119835,38 +126404,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 202 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -119888,11 +126433,38 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -119935,8 +126507,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -119968,10 +126540,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -119980,38 +126556,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_create_request( + _request = build_load_balancers_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -120031,12 +126610,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Load Balancers. To list all of the load balancer instances on your account, send a GET request @@ -120055,43 +126635,16 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "links": { "pages": {} }, "load_balancers": [ { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify - an algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time - value given in ISO8601 combined date and time format that represents when - the load balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. - Default value is False. A boolean value indicating whether to disable - automatic DNS record creation for Let's Encrypt certificates that are - added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value - is False. A boolean value indicating whether HTTP keepalive connections - are maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is - False. A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing - traffic to the load balancer (in the form 'ip:1.2.3.4' or - 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying - traffic to the load balancer (in the form 'ip:1.2.3.4' or - 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID - of the TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. @@ -120116,11 +126669,41 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID + of the TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify + an algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format that represents when + the load balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. + Default value is False. A boolean value indicating whether to disable + automatic DNS record creation for Let's Encrypt certificates that are + added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value + is False. A boolean value indicating whether HTTP keepalive connections + are maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is + False. A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing + traffic to the load balancer (in the form 'ip:1.2.3.4' or + 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying + traffic to the load balancer (in the form 'ip:1.2.3.4' or + 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive @@ -120164,11 +126747,11 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now - equates to the load balancer having a set number of nodes."n"n"n* - ``lb-small`` = 1 node"n* ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 - nodes"n"nYou can resize load balancers after creation up to once per - hour. You cannot resize a load balancer within the first hour of its - creation. Known values are: "lb-small", "lb-medium", and "lb-large". + equates to the load balancer having a set number of nodes. * + ``lb-small`` = 1 node * ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes + You can resize load balancers after creation up to once per hour. You + cannot resize a load balancer within the first hour of its creation. + Known values are: "lb-small", "lb-medium", and "lb-large". "size_unit": 1, # Optional. Default value is 1. How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be @@ -120197,16 +126780,17 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: "vpc_uuid": "str" # Optional. A string specifying the UUID of the VPC to which the load balancer is assigned. } - ], - "meta": { - "total": 0 # Optional. Number of objects returned by the request. - } + ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -120215,26 +126799,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_load_balancers_list_request( + _request = build_load_balancers_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -120254,12 +126841,13 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, lb_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Load Balancer. To show information about a load balancer instance, send a GET request to @@ -120277,35 +126865,8 @@ def get(self, lb_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -120327,11 +126888,38 @@ def get(self, lb_id: str, **kwargs: Any) -> JSON: balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -120374,8 +126962,8 @@ def get(self, lb_id: str, **kwargs: Any) -> JSON: "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -120418,10 +127006,14 @@ def get(self, lb_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -120430,25 +127022,28 @@ def get(self, lb_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_load_balancers_get_request( + _request = build_load_balancers_get_request( lb_id=lb_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -120485,9 +127080,9 @@ def get(self, lb_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update( @@ -120498,6 +127093,7 @@ def update( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Load Balancer. To update a load balancer's settings, send a PUT request to @@ -120527,35 +127123,8 @@ def update( # response body for status code(s): 200 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -120577,11 +127146,38 @@ def update( balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -120624,8 +127220,8 @@ def update( "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -120673,11 +127269,12 @@ def update( def update( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Load Balancer. To update a load balancer's settings, send a PUT request to @@ -120690,7 +127287,7 @@ def update( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -120704,35 +127301,8 @@ def update( # response body for status code(s): 200 response == { "load_balancer": { - "algorithm": "round_robin", # Optional. Default value is - "round_robin". This field has been deprecated. You can no longer specify an - algorithm for load balancers. Known values are: "round_robin" and - "least_connections". - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the load - balancer was created. - "disable_lets_encrypt_dns_records": False, # Optional. Default value - is False. A boolean value indicating whether to disable automatic DNS record - creation for Let's Encrypt certificates that are added to the load balancer. - "enable_backend_keepalive": False, # Optional. Default value is - False. A boolean value indicating whether HTTP keepalive connections are - maintained to target Droplets. - "enable_proxy_protocol": False, # Optional. Default value is False. - A boolean value indicating whether PROXY Protocol is in use. - "firewall": { - "allow": [ - "str" # Optional. the rules for allowing traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ], - "deny": [ - "str" # Optional. the rules for denying traffic to - the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). - ] - }, "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -120754,126 +127324,13 @@ def update( balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], - "health_check": { - "check_interval_seconds": 10, # Optional. Default value is - 10. The number of seconds between between two consecutive health checks. - "healthy_threshold": 3, # Optional. Default value is 3. The - number of times a health check must pass for a backend Droplet to be - marked "healthy" and be re-added to the pool. - "path": "/", # Optional. Default value is "/". The path on - the backend Droplets to which the load balancer instance will send a - request. - "port": 80, # Optional. Default value is 80. An integer - representing the port on the backend Droplets on which the health check - will attempt a connection. - "protocol": "http", # Optional. Default value is "http". The - protocol used for health checks sent to the backend Droplets. The - possible values are ``http``"" , ``https``"" , or ``tcp``. Known values - are: "http", "https", and "tcp". - "response_timeout_seconds": 5, # Optional. Default value is - 5. The number of seconds the load balancer instance will wait for a - response until marking a health check as failed. - "unhealthy_threshold": 5 # Optional. Default value is 5. The - number of times a health check must fail for a backend Droplet to be - marked "unhealthy" and be removed from the pool. - }, - "http_idle_timeout_seconds": 60, # Optional. Default value is 60. An - integer value which configures the idle timeout for HTTP requests to the - target droplets. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a load balancer. - "ip": "str", # Optional. An attribute containing the public-facing - IP address of the load balancer. - "name": "str", # Optional. A human-readable name for a load balancer - instance. - "project_id": "str", # Optional. The ID of the project that the load - balancer is associated with. If no ID is provided at creation, the load - balancer associates with the user's default project. If an invalid project ID - is provided, the load balancer will not be created. - "redirect_http_to_https": False, # Optional. Default value is False. - A boolean value indicating whether HTTP requests to the load balancer on port - 80 will be redirected to HTTPS on port 443. - "size": "lb-small", # Optional. Default value is "lb-small". This - field has been replaced by the ``size_unit`` field for all regions except in - AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load - balancers after creation up to once per hour. You cannot resize a load - balancer within the first hour of its creation. Known values are: "lb-small", - "lb-medium", and "lb-large". - "size_unit": 1, # Optional. Default value is 1. How many nodes the - load balancer contains. Each additional node increases the load balancer's - ability to manage more connections. Load balancers can be scaled up or down, - and you can change the number of nodes after creation up to once per hour. - This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use - the ``size`` field to scale load balancers that reside in these regions. - "status": "str", # Optional. A status string indicating the current - state of the load balancer. This can be ``new``"" , ``active``"" , or - ``errored``. Known values are: "new", "active", and "errored". - "sticky_sessions": { - "cookie_name": "str", # Optional. The name of the cookie - sent to the client. This attribute is only returned when using - ``cookies`` for the sticky sessions type. - "cookie_ttl_seconds": 0, # Optional. The number of seconds - until the cookie set by the load balancer expires. This attribute is only - returned when using ``cookies`` for the sticky sessions type. - "type": "none" # Optional. Default value is "none". An - attribute indicating how and if requests from a client will be - persistently served by the same backend Droplet. The possible values are - ``cookies`` or ``none``. Known values are: "cookies" and "none". - }, - "tag": "str", # Optional. The name of a Droplet tag corresponding to - Droplets assigned to the load balancer. - "vpc_uuid": "str" # Optional. A string specifying the UUID of the - VPC to which the load balancer is assigned. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace - def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Update a Load Balancer. - - To update a load balancer's settings, send a PUT request to - ``/v2/load_balancers/$LOAD_BALANCER_ID``. The request should contain a full - representation of the load balancer including existing attributes. It may - contain *one of* the ``droplets_ids`` or ``tag`` attributes as they are mutually - exclusive. **Note that any attribute that is not provided will be reset to its - default value.**. - - :param lb_id: A unique identifier for a load balancer. Required. - :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "load_balancer": { "algorithm": "round_robin", # Optional. Default value is "round_robin". This field has been deprecated. You can no longer specify an algorithm for load balancers. Known values are: "round_robin" and @@ -120899,10 +127356,124 @@ def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). ] }, + "health_check": { + "check_interval_seconds": 10, # Optional. Default value is + 10. The number of seconds between between two consecutive health checks. + "healthy_threshold": 3, # Optional. Default value is 3. The + number of times a health check must pass for a backend Droplet to be + marked "healthy" and be re-added to the pool. + "path": "/", # Optional. Default value is "/". The path on + the backend Droplets to which the load balancer instance will send a + request. + "port": 80, # Optional. Default value is 80. An integer + representing the port on the backend Droplets on which the health check + will attempt a connection. + "protocol": "http", # Optional. Default value is "http". The + protocol used for health checks sent to the backend Droplets. The + possible values are ``http``"" , ``https``"" , or ``tcp``. Known values + are: "http", "https", and "tcp". + "response_timeout_seconds": 5, # Optional. Default value is + 5. The number of seconds the load balancer instance will wait for a + response until marking a health check as failed. + "unhealthy_threshold": 5 # Optional. Default value is 5. The + number of times a health check must fail for a backend Droplet to be + marked "unhealthy" and be removed from the pool. + }, + "http_idle_timeout_seconds": 60, # Optional. Default value is 60. An + integer value which configures the idle timeout for HTTP requests to the + target droplets. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a load balancer. + "ip": "str", # Optional. An attribute containing the public-facing + IP address of the load balancer. + "name": "str", # Optional. A human-readable name for a load balancer + instance. + "project_id": "str", # Optional. The ID of the project that the load + balancer is associated with. If no ID is provided at creation, the load + balancer associates with the user's default project. If an invalid project ID + is provided, the load balancer will not be created. + "redirect_http_to_https": False, # Optional. Default value is False. + A boolean value indicating whether HTTP requests to the load balancer on port + 80 will be redirected to HTTPS on port 443. + "size": "lb-small", # Optional. Default value is "lb-small". This + field has been replaced by the ``size_unit`` field for all regions except in + AMS2, NYC2, and SFO1. Each available load balancer size now equates to the + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load + balancers after creation up to once per hour. You cannot resize a load + balancer within the first hour of its creation. Known values are: "lb-small", + "lb-medium", and "lb-large". + "size_unit": 1, # Optional. Default value is 1. How many nodes the + load balancer contains. Each additional node increases the load balancer's + ability to manage more connections. Load balancers can be scaled up or down, + and you can change the number of nodes after creation up to once per hour. + This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use + the ``size`` field to scale load balancers that reside in these regions. + "status": "str", # Optional. A status string indicating the current + state of the load balancer. This can be ``new``"" , ``active``"" , or + ``errored``. Known values are: "new", "active", and "errored". + "sticky_sessions": { + "cookie_name": "str", # Optional. The name of the cookie + sent to the client. This attribute is only returned when using + ``cookies`` for the sticky sessions type. + "cookie_ttl_seconds": 0, # Optional. The number of seconds + until the cookie set by the load balancer expires. This attribute is only + returned when using ``cookies`` for the sticky sessions type. + "type": "none" # Optional. Default value is "none". An + attribute indicating how and if requests from a client will be + persistently served by the same backend Droplet. The possible values are + ``cookies`` or ``none``. Known values are: "cookies" and "none". + }, + "tag": "str", # Optional. The name of a Droplet tag corresponding to + Droplets assigned to the load balancer. + "vpc_uuid": "str" # Optional. A string specifying the UUID of the + VPC to which the load balancer is assigned. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def update(self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update a Load Balancer. + + To update a load balancer's settings, send a PUT request to + ``/v2/load_balancers/$LOAD_BALANCER_ID``. The request should contain a full + representation of the load balancer including existing attributes. It may + contain *one of* the ``droplets_ids`` or ``tag`` attributes as they are mutually + exclusive. **Note that any attribute that is not provided will be reset to its + default value.**. + + :param lb_id: A unique identifier for a load balancer. Required. + :type lb_id: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = {} + + # response body for status code(s): 200 + response == { + "load_balancer": { "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the - TLS certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for @@ -120924,11 +127495,38 @@ def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the + TLS certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. } ], + "algorithm": "round_robin", # Optional. Default value is + "round_robin". This field has been deprecated. You can no longer specify an + algorithm for load balancers. Known values are: "round_robin" and + "least_connections". + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the load + balancer was created. + "disable_lets_encrypt_dns_records": False, # Optional. Default value + is False. A boolean value indicating whether to disable automatic DNS record + creation for Let's Encrypt certificates that are added to the load balancer. + "enable_backend_keepalive": False, # Optional. Default value is + False. A boolean value indicating whether HTTP keepalive connections are + maintained to target Droplets. + "enable_proxy_protocol": False, # Optional. Default value is False. + A boolean value indicating whether PROXY Protocol is in use. + "firewall": { + "allow": [ + "str" # Optional. the rules for allowing traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ], + "deny": [ + "str" # Optional. the rules for denying traffic to + the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16'). + ] + }, "health_check": { "check_interval_seconds": 10, # Optional. Default value is 10. The number of seconds between between two consecutive health checks. @@ -120971,8 +127569,8 @@ def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "size": "lb-small", # Optional. Default value is "lb-small". This field has been replaced by the ``size_unit`` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the - load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n* - ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load + load balancer having a set number of nodes. * ``lb-small`` = 1 node * + ``lb-medium`` = 3 nodes * ``lb-large`` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Known values are: "lb-small", "lb-medium", and "lb-large". @@ -121015,10 +127613,14 @@ def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121027,20 +127629,20 @@ def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_update_request( + _request = build_load_balancers_update_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -121048,18 +127650,21 @@ def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -121096,12 +127701,13 @@ def update(self, lb_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, lb_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Load Balancer. To delete a load balancer instance, disassociating any Droplets assigned to it @@ -121132,10 +127738,14 @@ def delete(self, lb_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121144,25 +127754,28 @@ def delete(self, lb_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_load_balancers_delete_request( + _request = build_load_balancers_delete_request( lb_id=lb_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -121195,9 +127808,9 @@ def delete(self, lb_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def add_droplets( @@ -121208,6 +127821,7 @@ def add_droplets( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Load Balancer. To assign a Droplet to a load balancer instance, send a POST request to @@ -121260,11 +127874,12 @@ def add_droplets( def add_droplets( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Load Balancer. To assign a Droplet to a load balancer instance, send a POST request to @@ -121281,7 +127896,7 @@ def add_droplets( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -121307,8 +127922,9 @@ def add_droplets( @distributed_trace def add_droplets( - self, lb_id: str, body: Union[JSON, IO], **kwargs: Any + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Droplets to a Load Balancer. To assign a Droplet to a load balancer instance, send a POST request to @@ -121324,11 +127940,8 @@ def add_droplets( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -121336,6 +127949,14 @@ def add_droplets( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "droplet_ids": [ + 0 # An array containing the IDs of the Droplets assigned to the load + balancer. Required. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -121348,10 +127969,14 @@ def add_droplets( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121360,20 +127985,20 @@ def add_droplets( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_add_droplets_request( + _request = build_load_balancers_add_droplets_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -121381,18 +128006,21 @@ def add_droplets( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -121425,9 +128053,9 @@ def add_droplets( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def remove_droplets( @@ -121438,6 +128066,7 @@ def remove_droplets( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Load Balancer. To remove a Droplet from a load balancer instance, send a DELETE request to @@ -121487,11 +128116,12 @@ def remove_droplets( def remove_droplets( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Load Balancer. To remove a Droplet from a load balancer instance, send a DELETE request to @@ -121505,7 +128135,7 @@ def remove_droplets( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -121531,8 +128161,9 @@ def remove_droplets( @distributed_trace def remove_droplets( - self, lb_id: str, body: Union[JSON, IO], **kwargs: Any + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Droplets from a Load Balancer. To remove a Droplet from a load balancer instance, send a DELETE request to @@ -121545,11 +128176,8 @@ def remove_droplets( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -121557,6 +128185,14 @@ def remove_droplets( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "droplet_ids": [ + 0 # An array containing the IDs of the Droplets assigned to the load + balancer. Required. + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -121569,10 +128205,14 @@ def remove_droplets( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121581,20 +128221,20 @@ def remove_droplets( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_remove_droplets_request( + _request = build_load_balancers_remove_droplets_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -121602,18 +128242,21 @@ def remove_droplets( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -121646,9 +128289,9 @@ def remove_droplets( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def add_forwarding_rules( @@ -121659,6 +128302,7 @@ def add_forwarding_rules( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Forwarding Rules to a Load Balancer. To add an additional forwarding rule to a load balancer instance, send a POST @@ -121688,8 +128332,6 @@ def add_forwarding_rules( body = { "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the TLS - certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for traffic to @@ -121710,6 +128352,8 @@ def add_forwarding_rules( up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the TLS + certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. @@ -121734,11 +128378,12 @@ def add_forwarding_rules( def add_forwarding_rules( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Forwarding Rules to a Load Balancer. To add an additional forwarding rule to a load balancer instance, send a POST @@ -121753,7 +128398,7 @@ def add_forwarding_rules( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -121779,8 +128424,9 @@ def add_forwarding_rules( @distributed_trace def add_forwarding_rules( - self, lb_id: str, body: Union[JSON, IO], **kwargs: Any + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Add Forwarding Rules to a Load Balancer. To add an additional forwarding rule to a load balancer instance, send a POST @@ -121794,11 +128440,8 @@ def add_forwarding_rules( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -121806,6 +128449,39 @@ def add_forwarding_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "forwarding_rules": [ + { + "entry_port": 0, # An integer representing the port on which + the load balancer instance will listen. Required. + "entry_protocol": "str", # The protocol used for traffic to + the load balancer. The possible values are: ``http``"" , ``https``"" , + ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If you set the + ``entry_protocol`` to ``udp``"" , the ``target_protocol`` must be set to + ``udp``. When using UDP, the load balancer requires that you set up a + health check with a port that uses TCP, HTTP, or HTTPS to work properly. + Required. Known values are: "http", "https", "http2", "http3", "tcp", and + "udp". + "target_port": 0, # An integer representing the port on the + backend Droplets to which the load balancer will send traffic. Required. + "target_protocol": "str", # The protocol used for traffic + from the load balancer to the backend Droplets. The possible values are: + ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or ``udp``. If you + set the ``target_protocol`` to ``udp``"" , the ``entry_protocol`` must be + set to ``udp``. When using UDP, the load balancer requires that you set + up a health check with a port that uses TCP, HTTP, or HTTPS to work + properly. Required. Known values are: "http", "https", "http2", "tcp", + and "udp". + "certificate_id": "str", # Optional. The ID of the TLS + certificate used for SSL termination if enabled. + "tls_passthrough": bool # Optional. A boolean value + indicating whether SSL encrypted traffic will be passed through to the + backend Droplets. + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -121818,10 +128494,14 @@ def add_forwarding_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -121830,20 +128510,20 @@ def add_forwarding_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_add_forwarding_rules_request( + _request = build_load_balancers_add_forwarding_rules_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -121851,18 +128531,21 @@ def add_forwarding_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -121895,9 +128578,9 @@ def add_forwarding_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def remove_forwarding_rules( @@ -121908,6 +128591,7 @@ def remove_forwarding_rules( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Forwarding Rules from a Load Balancer. To remove forwarding rules from a load balancer instance, send a DELETE @@ -121937,8 +128621,6 @@ def remove_forwarding_rules( body = { "forwarding_rules": [ { - "certificate_id": "str", # Optional. The ID of the TLS - certificate used for SSL termination if enabled. "entry_port": 0, # An integer representing the port on which the load balancer instance will listen. Required. "entry_protocol": "str", # The protocol used for traffic to @@ -121959,6 +128641,8 @@ def remove_forwarding_rules( up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. Required. Known values are: "http", "https", "http2", "tcp", and "udp". + "certificate_id": "str", # Optional. The ID of the TLS + certificate used for SSL termination if enabled. "tls_passthrough": bool # Optional. A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. @@ -121983,11 +128667,12 @@ def remove_forwarding_rules( def remove_forwarding_rules( self, lb_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Forwarding Rules from a Load Balancer. To remove forwarding rules from a load balancer instance, send a DELETE @@ -122002,7 +128687,7 @@ def remove_forwarding_rules( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -122028,8 +128713,9 @@ def remove_forwarding_rules( @distributed_trace def remove_forwarding_rules( - self, lb_id: str, body: Union[JSON, IO], **kwargs: Any + self, lb_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Remove Forwarding Rules from a Load Balancer. To remove forwarding rules from a load balancer instance, send a DELETE @@ -122043,11 +128729,8 @@ def remove_forwarding_rules( :param lb_id: A unique identifier for a load balancer. Required. :type lb_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -122055,6 +128738,39 @@ def remove_forwarding_rules( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "forwarding_rules": [ + { + "entry_port": 0, # An integer representing the port on which + the load balancer instance will listen. Required. + "entry_protocol": "str", # The protocol used for traffic to + the load balancer. The possible values are: ``http``"" , ``https``"" , + ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If you set the + ``entry_protocol`` to ``udp``"" , the ``target_protocol`` must be set to + ``udp``. When using UDP, the load balancer requires that you set up a + health check with a port that uses TCP, HTTP, or HTTPS to work properly. + Required. Known values are: "http", "https", "http2", "http3", "tcp", and + "udp". + "target_port": 0, # An integer representing the port on the + backend Droplets to which the load balancer will send traffic. Required. + "target_protocol": "str", # The protocol used for traffic + from the load balancer to the backend Droplets. The possible values are: + ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or ``udp``. If you + set the ``target_protocol`` to ``udp``"" , the ``entry_protocol`` must be + set to ``udp``. When using UDP, the load balancer requires that you set + up a health check with a port that uses TCP, HTTP, or HTTPS to work + properly. Required. Known values are: "http", "https", "http2", "tcp", + and "udp". + "certificate_id": "str", # Optional. The ID of the TLS + certificate used for SSL termination if enabled. + "tls_passthrough": bool # Optional. A boolean value + indicating whether SSL encrypted traffic will be passed through to the + backend Droplets. + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -122067,10 +128783,14 @@ def remove_forwarding_rules( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122079,20 +128799,20 @@ def remove_forwarding_rules( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_load_balancers_remove_forwarding_rules_request( + _request = build_load_balancers_remove_forwarding_rules_request( lb_id=lb_id, content_type=content_type, json=_json, @@ -122100,18 +128820,21 @@ def remove_forwarding_rules( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -122144,9 +128867,9 @@ def remove_forwarding_rules( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class MonitoringOperations: @@ -122172,6 +128895,7 @@ def __init__(self, *args, **kwargs): def list_alert_policy( self, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Alert Policies. Returns all alert policies that are configured for the given account. To List all alert @@ -122190,9 +128914,6 @@ def list_alert_policy( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, @@ -122254,13 +128975,20 @@ def list_alert_policy( "window": "str" # Required. Known values are: "5m", "10m", "30m", and "1h". } - ] + ], + "links": { + "pages": {} + } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122269,26 +128997,29 @@ def list_alert_policy( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_list_alert_policy_request( + _request = build_monitoring_list_alert_policy_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -122308,14 +129039,15 @@ def list_alert_policy( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_alert_policy( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Alert Policy. To create a new alert, send a POST request to ``/v2/monitoring/alerts``. @@ -122539,8 +129271,9 @@ def create_alert_policy( @overload def create_alert_policy( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Alert Policy. To create a new alert, send a POST request to ``/v2/monitoring/alerts``. @@ -122641,7 +129374,7 @@ def create_alert_policy( * - ``v1/dbaas/alerts/cpu_alerts`` - alert on the percent CPU usage average across the database cluster - database cluster UUID. Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -122712,7 +129445,8 @@ def create_alert_policy( """ @distributed_trace - def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create_alert_policy(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create Alert Policy. To create a new alert, send a POST request to ``/v2/monitoring/alerts``. @@ -122812,11 +129546,8 @@ def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - database cluster UUID * - ``v1/dbaas/alerts/cpu_alerts`` - alert on the percent CPU usage average across the database cluster - - database cluster UUID. Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + - database cluster UUID. Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -122824,6 +129555,57 @@ def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "alerts": { + "email": [ + "str" # An email to notify on an alert trigger. Required. + ], + "slack": [ + { + "channel": "str", # Slack channel to notify of an + alert trigger. Required. + "url": "str" # Slack Webhook URL. Required. + } + ] + }, + "compare": "str", # Required. Known values are: "GreaterThan" and + "LessThan". + "description": "str", # Required. + "enabled": bool, # Required. + "entities": [ + "str" # Required. + ], + "tags": [ + "str" # Required. + ], + "type": "str", # Required. Known values are: "v1/insights/droplet/load_1", + "v1/insights/droplet/load_5", "v1/insights/droplet/load_15", + "v1/insights/droplet/memory_utilization_percent", + "v1/insights/droplet/disk_utilization_percent", "v1/insights/droplet/cpu", + "v1/insights/droplet/disk_read", "v1/insights/droplet/disk_write", + "v1/insights/droplet/public_outbound_bandwidth", + "v1/insights/droplet/public_inbound_bandwidth", + "v1/insights/droplet/private_outbound_bandwidth", + "v1/insights/droplet/private_inbound_bandwidth", + "v1/insights/lbaas/avg_cpu_utilization_percent", + "v1/insights/lbaas/connection_utilization_percent", + "v1/insights/lbaas/droplet_health", + "v1/insights/lbaas/tls_connections_per_second_utilization_percent", + "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx", + "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx", + "v1/insights/lbaas/increase_in_http_error_rate_count_5xx", + "v1/insights/lbaas/increase_in_http_error_rate_count_4xx", + "v1/insights/lbaas/high_http_request_response_time", + "v1/insights/lbaas/high_http_request_response_time_50p", + "v1/insights/lbaas/high_http_request_response_time_95p", + "v1/insights/lbaas/high_http_request_response_time_99p", + "v1/dbaas/alerts/load_15_alerts", "v1/dbaas/alerts/memory_utilization_alerts", + "v1/dbaas/alerts/disk_utilization_alerts", and "v1/dbaas/alerts/cpu_alerts". + "value": 0.0, # Required. + "window": "str" # Required. Known values are: "5m", "10m", "30m", and "1h". + } + # response body for status code(s): 200 response == { "policy": { @@ -122882,10 +129664,14 @@ def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -122894,38 +129680,41 @@ def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_monitoring_create_alert_policy_request( + _request = build_monitoring_create_alert_policy_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -122945,12 +129734,13 @@ def create_alert_policy(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_alert_policy(self, alert_uuid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Alert Policy. To retrieve a given alert policy, send a GET request to ``/v2/monitoring/alerts/{alert_uuid}``. @@ -123033,10 +129823,14 @@ def get_alert_policy(self, alert_uuid: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123045,25 +129839,28 @@ def get_alert_policy(self, alert_uuid: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_alert_policy_request( + _request = build_monitoring_get_alert_policy_request( alert_uuid=alert_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -123100,9 +129897,9 @@ def get_alert_policy(self, alert_uuid: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_alert_policy( @@ -123113,6 +129910,7 @@ def update_alert_policy( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update an Alert Policy. To update en existing policy, send a PUT request to ``v2/monitoring/alerts/{alert_uuid}``. @@ -123351,11 +130149,12 @@ def update_alert_policy( def update_alert_policy( self, alert_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update an Alert Policy. To update en existing policy, send a PUT request to ``v2/monitoring/alerts/{alert_uuid}``. @@ -123458,7 +130257,7 @@ def update_alert_policy( * - ``v1/dbaas/alerts/cpu_alerts`` - alert on the percent CPU usage average across the database cluster - database cluster UUID. Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -123541,8 +130340,9 @@ def update_alert_policy( @distributed_trace def update_alert_policy( - self, alert_uuid: str, body: Union[JSON, IO], **kwargs: Any + self, alert_uuid: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Alert Policy. To update en existing policy, send a PUT request to ``v2/monitoring/alerts/{alert_uuid}``. @@ -123644,11 +130444,8 @@ def update_alert_policy( - database cluster UUID * - ``v1/dbaas/alerts/cpu_alerts`` - alert on the percent CPU usage average across the database cluster - - database cluster UUID. Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + - database cluster UUID. Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -123656,6 +130453,57 @@ def update_alert_policy( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "alerts": { + "email": [ + "str" # An email to notify on an alert trigger. Required. + ], + "slack": [ + { + "channel": "str", # Slack channel to notify of an + alert trigger. Required. + "url": "str" # Slack Webhook URL. Required. + } + ] + }, + "compare": "str", # Required. Known values are: "GreaterThan" and + "LessThan". + "description": "str", # Required. + "enabled": bool, # Required. + "entities": [ + "str" # Required. + ], + "tags": [ + "str" # Required. + ], + "type": "str", # Required. Known values are: "v1/insights/droplet/load_1", + "v1/insights/droplet/load_5", "v1/insights/droplet/load_15", + "v1/insights/droplet/memory_utilization_percent", + "v1/insights/droplet/disk_utilization_percent", "v1/insights/droplet/cpu", + "v1/insights/droplet/disk_read", "v1/insights/droplet/disk_write", + "v1/insights/droplet/public_outbound_bandwidth", + "v1/insights/droplet/public_inbound_bandwidth", + "v1/insights/droplet/private_outbound_bandwidth", + "v1/insights/droplet/private_inbound_bandwidth", + "v1/insights/lbaas/avg_cpu_utilization_percent", + "v1/insights/lbaas/connection_utilization_percent", + "v1/insights/lbaas/droplet_health", + "v1/insights/lbaas/tls_connections_per_second_utilization_percent", + "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx", + "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx", + "v1/insights/lbaas/increase_in_http_error_rate_count_5xx", + "v1/insights/lbaas/increase_in_http_error_rate_count_4xx", + "v1/insights/lbaas/high_http_request_response_time", + "v1/insights/lbaas/high_http_request_response_time_50p", + "v1/insights/lbaas/high_http_request_response_time_95p", + "v1/insights/lbaas/high_http_request_response_time_99p", + "v1/dbaas/alerts/load_15_alerts", "v1/dbaas/alerts/memory_utilization_alerts", + "v1/dbaas/alerts/disk_utilization_alerts", and "v1/dbaas/alerts/cpu_alerts". + "value": 0.0, # Required. + "window": "str" # Required. Known values are: "5m", "10m", "30m", and "1h". + } + # response body for status code(s): 200 response == { "policy": { @@ -123725,10 +130573,14 @@ def update_alert_policy( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123737,20 +130589,20 @@ def update_alert_policy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_monitoring_update_alert_policy_request( + _request = build_monitoring_update_alert_policy_request( alert_uuid=alert_uuid, content_type=content_type, json=_json, @@ -123758,18 +130610,21 @@ def update_alert_policy( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -123806,12 +130661,13 @@ def update_alert_policy( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_alert_policy(self, alert_uuid: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Alert Policy. To delete an alert policy, send a DELETE request to ``/v2/monitoring/alerts/{alert_uuid}``. @@ -123837,10 +130693,14 @@ def delete_alert_policy(self, alert_uuid: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123849,25 +130709,28 @@ def delete_alert_policy(self, alert_uuid: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_monitoring_delete_alert_policy_request( + _request = build_monitoring_delete_alert_policy_request( alert_uuid=alert_uuid, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -123900,9 +130763,9 @@ def delete_alert_policy(self, alert_uuid: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_droplet_bandwidth_metrics( @@ -123962,10 +130825,14 @@ def get_droplet_bandwidth_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -123974,9 +130841,9 @@ def get_droplet_bandwidth_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_bandwidth_metrics_request( + _request = build_monitoring_get_droplet_bandwidth_metrics_request( host_id=host_id, interface=interface, direction=direction, @@ -123985,18 +130852,21 @@ def get_droplet_bandwidth_metrics( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124016,9 +130886,9 @@ def get_droplet_bandwidth_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_cpu_metrics( @@ -124063,10 +130933,14 @@ def get_droplet_cpu_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124075,27 +130949,30 @@ def get_droplet_cpu_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_cpu_metrics_request( + _request = build_monitoring_get_droplet_cpu_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124115,9 +130992,9 @@ def get_droplet_cpu_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_filesystem_free_metrics( @@ -124162,10 +131039,14 @@ def get_droplet_filesystem_free_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124174,27 +131055,30 @@ def get_droplet_filesystem_free_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_filesystem_free_metrics_request( + _request = build_monitoring_get_droplet_filesystem_free_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124214,9 +131098,9 @@ def get_droplet_filesystem_free_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_filesystem_size_metrics( @@ -124261,10 +131145,14 @@ def get_droplet_filesystem_size_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124273,27 +131161,30 @@ def get_droplet_filesystem_size_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_filesystem_size_metrics_request( + _request = build_monitoring_get_droplet_filesystem_size_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124313,9 +131204,9 @@ def get_droplet_filesystem_size_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_load1_metrics( @@ -124360,10 +131251,14 @@ def get_droplet_load1_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124372,27 +131267,30 @@ def get_droplet_load1_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_load1_metrics_request( + _request = build_monitoring_get_droplet_load1_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124412,9 +131310,9 @@ def get_droplet_load1_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_load5_metrics( @@ -124459,10 +131357,14 @@ def get_droplet_load5_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124471,27 +131373,30 @@ def get_droplet_load5_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_load5_metrics_request( + _request = build_monitoring_get_droplet_load5_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124511,9 +131416,9 @@ def get_droplet_load5_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_load15_metrics( @@ -124558,10 +131463,14 @@ def get_droplet_load15_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124570,27 +131479,30 @@ def get_droplet_load15_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_load15_metrics_request( + _request = build_monitoring_get_droplet_load15_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124610,9 +131522,9 @@ def get_droplet_load15_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_memory_cached_metrics( @@ -124657,10 +131569,14 @@ def get_droplet_memory_cached_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124669,27 +131585,30 @@ def get_droplet_memory_cached_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_memory_cached_metrics_request( + _request = build_monitoring_get_droplet_memory_cached_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124709,9 +131628,9 @@ def get_droplet_memory_cached_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_memory_free_metrics( @@ -124756,10 +131675,14 @@ def get_droplet_memory_free_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124768,27 +131691,30 @@ def get_droplet_memory_free_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_memory_free_metrics_request( + _request = build_monitoring_get_droplet_memory_free_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124808,9 +131734,9 @@ def get_droplet_memory_free_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_memory_total_metrics( @@ -124855,10 +131781,14 @@ def get_droplet_memory_total_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124867,27 +131797,30 @@ def get_droplet_memory_total_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_memory_total_metrics_request( + _request = build_monitoring_get_droplet_memory_total_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -124907,9 +131840,9 @@ def get_droplet_memory_total_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_droplet_memory_available_metrics( @@ -124954,10 +131887,14 @@ def get_droplet_memory_available_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -124966,27 +131903,30 @@ def get_droplet_memory_available_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_droplet_memory_available_metrics_request( + _request = build_monitoring_get_droplet_memory_available_metrics_request( host_id=host_id, start=start, end=end, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125006,9 +131946,9 @@ def get_droplet_memory_available_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_app_memory_percentage_metrics( @@ -125061,10 +132001,14 @@ def get_app_memory_percentage_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125073,9 +132017,9 @@ def get_app_memory_percentage_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_app_memory_percentage_metrics_request( + _request = build_monitoring_get_app_memory_percentage_metrics_request( app_id=app_id, start=start, end=end, @@ -125083,18 +132027,21 @@ def get_app_memory_percentage_metrics( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125114,9 +132061,9 @@ def get_app_memory_percentage_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_app_cpu_percentage_metrics( @@ -125169,10 +132116,14 @@ def get_app_cpu_percentage_metrics( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125181,9 +132132,9 @@ def get_app_cpu_percentage_metrics( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_app_cpu_percentage_metrics_request( + _request = build_monitoring_get_app_cpu_percentage_metrics_request( app_id=app_id, start=start, end=end, @@ -125191,18 +132142,21 @@ def get_app_cpu_percentage_metrics( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125222,9 +132176,9 @@ def get_app_cpu_percentage_metrics( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_app_restart_count_metrics_yml( @@ -125277,10 +132231,14 @@ def get_app_restart_count_metrics_yml( "status": "str" # Required. Known values are: "success" and "error". } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125289,9 +132247,9 @@ def get_app_restart_count_metrics_yml( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_monitoring_get_app_restart_count_metrics_yml_request( + _request = build_monitoring_get_app_restart_count_metrics_yml_request( app_id=app_id, start=start, end=end, @@ -125299,18 +132257,21 @@ def get_app_restart_count_metrics_yml( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125330,9 +132291,9 @@ def get_app_restart_count_metrics_yml( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class ProjectsOperations: @@ -125356,6 +132317,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Projects. To list all your projects, send a GET request to ``/v2/projects``. @@ -125373,12 +132335,12 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "projects": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -125401,13 +132363,13 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. - The maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / - Educational purposes"n* Website or blog"n* Web Application"n* Service or - API"n* Mobile Application"n* Machine learning / AI / Data processing"n* - IoT"n* Operational / Developer tooling"n"nIf another value for purpose is - specified, for example, "your custom purpose","nyour purpose will be - stored as ``Other: your custom purpose``. + The maximum length is 255 characters. It can have one of the following + values: * Just trying out DigitalOcean * Class project / Educational + purposes * Website or blog * Web Application * Service or API * Mobile + Application * Machine learning / AI / Data processing * IoT * Operational + / Developer tooling If another value for purpose is specified, for + example, "your custom purpose", your purpose will be stored as ``Other: + your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -125415,10 +132377,14 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125427,26 +132393,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_list_request( + _request = build_projects_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125466,14 +132435,15 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Project. To create a project, send a POST request to ``/v2/projects``. @@ -125506,12 +132476,12 @@ def create( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -125537,13 +132507,12 @@ def create( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -125553,14 +132522,15 @@ def create( @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a Project. To create a project, send a POST request to ``/v2/projects``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -125591,13 +132561,12 @@ def create( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -125606,16 +132575,14 @@ def create( """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a Project. To create a project, send a POST request to ``/v2/projects``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -125623,6 +132590,33 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. + } + # response body for status code(s): 201 response == { "project": { @@ -125643,23 +132637,26 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125668,38 +132665,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_create_request( + _request = build_projects_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125719,12 +132719,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_default(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve the Default Project. To get your default project, send a GET request to ``/v2/projects/default``. @@ -125756,13 +132757,12 @@ def get_default(self, **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -125780,10 +132780,14 @@ def get_default(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -125792,24 +132796,27 @@ def get_default(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_get_default_request( + _request = build_projects_get_default_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -125846,14 +132853,15 @@ def get_default(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update the Default Project. To update you default project, send a PUT request to ``/v2/projects/default``. All of the @@ -125889,12 +132897,12 @@ def update_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -125920,13 +132928,12 @@ def update_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -125947,15 +132954,16 @@ def update_default( @overload def update_default( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update the Default Project. To update you default project, send a PUT request to ``/v2/projects/default``. All of the following attributes must be sent. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -125986,13 +132994,12 @@ def update_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126012,17 +133019,15 @@ def update_default( """ @distributed_trace - def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def update_default(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Update the Default Project. To update you default project, send a PUT request to ``/v2/projects/default``. All of the following attributes must be sent. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -126030,6 +133035,35 @@ def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "is_default": bool, # Optional. If true, all resources will be added to this + project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. + } + # response body for status code(s): 200 response == { "project": { @@ -126050,13 +133084,12 @@ def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126074,10 +133107,14 @@ def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126086,38 +133123,41 @@ def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_update_default_request( + _request = build_projects_update_default_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -126154,14 +133194,15 @@ def update_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def patch_default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Patch the Default Project. To update only specific attributes of your default project, send a PATCH request to @@ -126197,12 +133238,12 @@ def patch_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126228,13 +133269,78 @@ def patch_default( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given + in ISO8601 combined date and time format that represents when the project was + updated. + } + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def patch_default( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Patch the Default Project. + + To update only specific attributes of your default project, send a PATCH request to + ``/v2/projects/default``. At least one of the following attributes needs to be sent. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "project": { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. + The maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this + project. + "is_default": bool, # Optional. If true, all resources will be added + to this project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. + The maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of + the project owner. + "purpose": "str", # Optional. The purpose of the project. The + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126253,20 +133359,16 @@ def patch_default( } """ - @overload - def patch_default( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: + @distributed_trace + def patch_default(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Patch the Default Project. To update only specific attributes of your default project, send a PATCH request to ``/v2/projects/default``. At least one of the following attributes needs to be sent. - :param body: Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -126274,69 +133376,34 @@ def patch_default( Example: .. code-block:: python - # response body for status code(s): 200 - response == { - "project": { - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the project was - created. - "description": "str", # Optional. The description of the project. - The maximum length is 255 characters. - "environment": "str", # Optional. The environment of the project's - resources. Known values are: "Development", "Staging", and "Production". - "id": "str", # Optional. The unique universal identifier of this - project. - "is_default": bool, # Optional. If true, all resources will be added - to this project if no project is specified. - "name": "str", # Optional. The human-readable name for the project. - The maximum length is 175 characters and the name must be unique. - "owner_id": 0, # Optional. The integer id of the project owner. - "owner_uuid": "str", # Optional. The unique universal identifier of - the project owner. - "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. - "updated_at": "2020-02-20 00:00:00" # Optional. A time value given - in ISO8601 combined date and time format that represents when the project was - updated. - } - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "is_default": bool, # Optional. If true, all resources will be added to this + project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. } - """ - - @distributed_trace - def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Patch the Default Project. - - To update only specific attributes of your default project, send a PATCH request to - ``/v2/projects/default``. At least one of the following attributes needs to be sent. - - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python # response body for status code(s): 200 response == { @@ -126358,13 +133425,12 @@ def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126382,10 +133448,14 @@ def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126394,38 +133464,41 @@ def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_patch_default_request( + _request = build_projects_patch_default_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -126462,12 +133535,13 @@ def patch_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, project_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Project. To get a project, send a GET request to ``/v2/projects/$PROJECT_ID``. @@ -126501,13 +133575,12 @@ def get(self, project_id: str, **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126525,10 +133598,14 @@ def get(self, project_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126537,25 +133614,28 @@ def get(self, project_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_get_request( + _request = build_projects_get_request( project_id=project_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -126592,9 +133672,9 @@ def get(self, project_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update( @@ -126605,6 +133685,7 @@ def update( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Project. To update a project, send a PUT request to ``/v2/projects/$PROJECT_ID``. All of the following @@ -126642,12 +133723,12 @@ def update( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126673,13 +133754,12 @@ def update( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126702,11 +133782,12 @@ def update( def update( self, project_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Project. To update a project, send a PUT request to ``/v2/projects/$PROJECT_ID``. All of the following @@ -126715,7 +133796,7 @@ def update( :param project_id: A unique identifier for a project. Required. :type project_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -126746,13 +133827,12 @@ def update( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126772,7 +133852,10 @@ def update( """ @distributed_trace - def update(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def update( + self, project_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Update a Project. To update a project, send a PUT request to ``/v2/projects/$PROJECT_ID``. All of the following @@ -126780,11 +133863,8 @@ def update(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: :param project_id: A unique identifier for a project. Required. :type project_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -126792,6 +133872,35 @@ def update(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "is_default": bool, # Optional. If true, all resources will be added to this + project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. + } + # response body for status code(s): 200 response == { "project": { @@ -126812,13 +133921,12 @@ def update(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126836,10 +133944,14 @@ def update(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -126848,20 +133960,20 @@ def update(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_update_request( + _request = build_projects_update_request( project_id=project_id, content_type=content_type, json=_json, @@ -126869,18 +133981,21 @@ def update(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -126917,9 +134032,9 @@ def update(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def patch( @@ -126930,6 +134045,7 @@ def patch( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Patch a Project. To update only specific attributes of a project, send a PATCH request to @@ -126967,12 +134083,12 @@ def patch( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The maximum length - is 255 characters. It can"nhave one of the following values:"n"n"n* Just trying - out DigitalOcean"n* Class project / Educational purposes"n* Website or blog"n* - Web Application"n* Service or API"n* Mobile Application"n* Machine learning / AI - / Data processing"n* IoT"n* Operational / Developer tooling"n"nIf another value - for purpose is specified, for example, "your custom purpose","nyour purpose will - be stored as ``Other: your custom purpose``. + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -126998,13 +134114,12 @@ def patch( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -127027,11 +134142,12 @@ def patch( def patch( self, project_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Patch a Project. To update only specific attributes of a project, send a PATCH request to @@ -127040,7 +134156,7 @@ def patch( :param project_id: A unique identifier for a project. Required. :type project_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -127071,13 +134187,12 @@ def patch( "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -127097,7 +134212,10 @@ def patch( """ @distributed_trace - def patch(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def patch( + self, project_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Patch a Project. To update only specific attributes of a project, send a PATCH request to @@ -127105,11 +134223,8 @@ def patch(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: :param project_id: A unique identifier for a project. Required. :type project_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -127117,6 +134232,35 @@ def patch(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "created_at": "2020-02-20 00:00:00", # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + created. + "description": "str", # Optional. The description of the project. The + maximum length is 255 characters. + "environment": "str", # Optional. The environment of the project's + resources. Known values are: "Development", "Staging", and "Production". + "id": "str", # Optional. The unique universal identifier of this project. + "is_default": bool, # Optional. If true, all resources will be added to this + project if no project is specified. + "name": "str", # Optional. The human-readable name for the project. The + maximum length is 175 characters and the name must be unique. + "owner_id": 0, # Optional. The integer id of the project owner. + "owner_uuid": "str", # Optional. The unique universal identifier of the + project owner. + "purpose": "str", # Optional. The purpose of the project. The maximum length + is 255 characters. It can have one of the following values: * Just trying out + DigitalOcean * Class project / Educational purposes * Website or blog * Web + Application * Service or API * Mobile Application * Machine learning / AI / Data + processing * IoT * Operational / Developer tooling If another value for purpose + is specified, for example, "your custom purpose", your purpose will be stored as + ``Other: your custom purpose``. + "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in + ISO8601 combined date and time format that represents when the project was + updated. + } + # response body for status code(s): 200 response == { "project": { @@ -127137,13 +134281,12 @@ def patch(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: "owner_uuid": "str", # Optional. The unique universal identifier of the project owner. "purpose": "str", # Optional. The purpose of the project. The - maximum length is 255 characters. It can"nhave one of the following - values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational - purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile - Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational - / Developer tooling"n"nIf another value for purpose is specified, for - example, "your custom purpose","nyour purpose will be stored as ``Other: your - custom purpose``. + maximum length is 255 characters. It can have one of the following values: + * Just trying out DigitalOcean * Class project / Educational purposes * + Website or blog * Web Application * Service or API * Mobile Application * + Machine learning / AI / Data processing * IoT * Operational / Developer + tooling If another value for purpose is specified, for example, "your custom + purpose", your purpose will be stored as ``Other: your custom purpose``. "updated_at": "2020-02-20 00:00:00" # Optional. A time value given in ISO8601 combined date and time format that represents when the project was updated. @@ -127161,10 +134304,14 @@ def patch(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127173,20 +134320,20 @@ def patch(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_patch_request( + _request = build_projects_patch_request( project_id=project_id, content_type=content_type, json=_json, @@ -127194,18 +134341,21 @@ def patch(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -127242,12 +134392,13 @@ def patch(self, project_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, project_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Existing Project. To delete a project, send a DELETE request to ``/v2/projects/$PROJECT_ID``. To @@ -127278,10 +134429,14 @@ def delete(self, project_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127290,25 +134445,28 @@ def delete(self, project_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_projects_delete_request( + _request = build_projects_delete_request( project_id=project_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404, 412]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -127357,14 +134515,15 @@ def delete(self, project_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_resources( self, project_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Project Resources. To list all your resources in a project, send a GET request to @@ -127385,12 +134544,12 @@ def list_resources( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "resources": [ { "assigned_at": "2020-02-20 00:00:00", # Optional. A time @@ -127420,10 +134579,14 @@ def list_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127432,27 +134595,30 @@ def list_resources( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_list_resources_request( + _request = build_projects_list_resources_request( project_id=project_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -127489,9 +134655,9 @@ def list_resources( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def assign_resources( @@ -127502,6 +134668,7 @@ def assign_resources( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to a Project. To assign resources to a project, send a POST request to @@ -127565,11 +134732,12 @@ def assign_resources( def assign_resources( self, project_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to a Project. To assign resources to a project, send a POST request to @@ -127578,7 +134746,7 @@ def assign_resources( :param project_id: A unique identifier for a project. Required. :type project_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -127623,8 +134791,9 @@ def assign_resources( @distributed_trace def assign_resources( - self, project_id: str, body: Union[JSON, IO], **kwargs: Any + self, project_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to a Project. To assign resources to a project, send a POST request to @@ -127632,11 +134801,8 @@ def assign_resources( :param project_id: A unique identifier for a project. Required. :type project_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -127644,6 +134810,14 @@ def assign_resources( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "resources": [ + "str" # Optional. A list of uniform resource names (URNs) to be + added to a project. + ] + } + # response body for status code(s): 200 response == { "resources": [ @@ -127675,10 +134849,14 @@ def assign_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127687,20 +134865,20 @@ def assign_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_assign_resources_request( + _request = build_projects_assign_resources_request( project_id=project_id, content_type=content_type, json=_json, @@ -127708,18 +134886,21 @@ def assign_resources( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -127756,12 +134937,13 @@ def assign_resources( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_resources_default(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Default Project Resources. To list all your resources in your default project, send a GET request to @@ -127776,12 +134958,12 @@ def list_resources_default(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "resources": [ { "assigned_at": "2020-02-20 00:00:00", # Optional. A time @@ -127811,10 +134993,14 @@ def list_resources_default(self, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -127823,24 +135009,27 @@ def list_resources_default(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_projects_list_resources_default_request( + _request = build_projects_list_resources_default_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -127877,14 +135066,15 @@ def list_resources_default(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def assign_resources_default( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to Default Project. To assign resources to your default project, send a POST request to @@ -127944,15 +135134,16 @@ def assign_resources_default( @overload def assign_resources_default( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to Default Project. To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -127996,17 +135187,17 @@ def assign_resources_default( """ @distributed_trace - def assign_resources_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def assign_resources_default( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Assign Resources to Default Project. To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -128014,6 +135205,14 @@ def assign_resources_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "resources": [ + "str" # Optional. A list of uniform resource names (URNs) to be + added to a project. + ] + } + # response body for status code(s): 200 response == { "resources": [ @@ -128045,10 +135244,14 @@ def assign_resources_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128057,38 +135260,41 @@ def assign_resources_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_projects_assign_resources_default_request( + _request = build_projects_assign_resources_default_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -128125,9 +135331,9 @@ def assign_resources_default(self, body: Union[JSON, IO], **kwargs: Any) -> JSON deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class RegionsOperations: @@ -128151,6 +135357,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Data Center Regions. To list all of the regions that are available, send a GET request to ``/v2/regions``. @@ -128170,9 +135377,6 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, @@ -128191,13 +135395,20 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: "slug": "str" # A human-readable string that is used as a unique identifier for each region. Required. } - ] + ], + "links": { + "pages": {} + } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128206,26 +135417,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_regions_list_request( + _request = build_regions_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -128245,9 +135459,9 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class RegistryOperations: @@ -128271,6 +135485,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def get(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Container Registry Information. To get information about your container registry, send a GET request to ``/v2/registry``. @@ -128330,10 +135545,14 @@ def get(self, **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128342,24 +135561,27 @@ def get(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_request( + _request = build_registry_get_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -128379,20 +135601,21 @@ def get(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Container Registry. To create your container registry, send a POST request to ``/v2/registry``. The ``name`` becomes part of the URL for images stored in the registry. For - example, if your registry is called ``example``\ , an image in it will have the + example, if your registry is called ``example``\\ , an image in it will have the URL ``registry.digitalocean.com/example/image:tag``. :param body: Required. @@ -128412,12 +135635,12 @@ def create( "name": "str", # A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and ``-``"" , up to a limit of 63 characters. Required. - "region": "str", # Optional. Slug of the region where registry data is - stored. When not provided, a region will be selected. Known values are: "nyc3", - "sfo3", "ams3", "sgp1", and "fra1". - "subscription_tier_slug": "str" # The slug of the subscription tier to sign + "subscription_tier_slug": "str", # The slug of the subscription tier to sign up for. Valid values can be retrieved using the options endpoint. Required. Known values are: "starter", "basic", and "professional". + "region": "str" # Optional. Slug of the region where registry data is + stored. When not provided, a region will be selected. Known values are: "nyc3", + "sfo3", "ams3", "sgp1", and "fra1". } # response body for status code(s): 201 @@ -128471,18 +135694,19 @@ def create( @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create Container Registry. To create your container registry, send a POST request to ``/v2/registry``. The ``name`` becomes part of the URL for images stored in the registry. For - example, if your registry is called ``example``\ , an image in it will have the + example, if your registry is called ``example``\\ , an image in it will have the URL ``registry.digitalocean.com/example/image:tag``. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -128543,20 +135767,18 @@ def create( """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create Container Registry. To create your container registry, send a POST request to ``/v2/registry``. The ``name`` becomes part of the URL for images stored in the registry. For - example, if your registry is called ``example``\ , an image in it will have the + example, if your registry is called ``example``\\ , an image in it will have the URL ``registry.digitalocean.com/example/image:tag``. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -128564,6 +135786,19 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A globally unique name for the container registry. Must be + lowercase and be composed only of numbers, letters and ``-``"" , up to a limit of + 63 characters. Required. + "subscription_tier_slug": "str", # The slug of the subscription tier to sign + up for. Valid values can be retrieved using the options endpoint. Required. Known + values are: "starter", "basic", and "professional". + "region": "str" # Optional. Slug of the region where registry data is + stored. When not provided, a region will be selected. Known values are: "nyc3", + "sfo3", "ams3", "sgp1", and "fra1". + } + # response body for status code(s): 201 response == { "registry": { @@ -128612,10 +135847,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128624,38 +135863,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_registry_create_request( + _request = build_registry_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -128675,12 +135917,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Container Registry. To delete your container registry, destroying all container image data stored in it, send a @@ -128705,10 +135948,14 @@ def delete(self, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128717,24 +135964,27 @@ def delete(self, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_registry_delete_request( + _request = build_registry_delete_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -128767,12 +136017,13 @@ def delete(self, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_subscription(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Subscription Information. A subscription is automatically created when you configure your container registry. To get @@ -128817,10 +136068,14 @@ def get_subscription(self, **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -128829,24 +136084,27 @@ def get_subscription(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_subscription_request( + _request = build_registry_get_subscription_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -128866,9 +136124,9 @@ def get_subscription(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_subscription( @@ -128878,6 +136136,7 @@ def update_subscription( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Subscription Tier. After creating your registry, you can switch to a different subscription tier to better suit @@ -128937,18 +136196,19 @@ def update_subscription( @overload def update_subscription( self, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Subscription Tier. After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to ``/v2/registry/subscription``. :param body: Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -128994,18 +136254,16 @@ def update_subscription( @distributed_trace def update_subscription( - self, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, body: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update Subscription Tier. After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to ``/v2/registry/subscription``. - :param body: Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Default value is None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -129013,6 +136271,12 @@ def update_subscription( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "tier_slug": "str" # Optional. The slug of the subscription tier to sign up + for. Known values are: "starter", "basic", and "professional". + } + # response body for status code(s): 200 response == { "subscription": { @@ -129045,10 +136309,14 @@ def update_subscription( } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129057,15 +136325,15 @@ def update_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -129073,25 +136341,28 @@ def update_subscription( else: _json = None - request = build_registry_update_subscription_request( + _request = build_registry_update_subscription_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129111,9 +136382,9 @@ def update_subscription( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_docker_credentials( @@ -129131,8 +136402,8 @@ def get_docker_credentials( .. code-block:: - kubectl create secret generic docr \ - --from-file=.dockerconfigjson=config.json \ + kubectl create secret generic docr \\ + --from-file=.dockerconfigjson=config.json \\ --type=kubernetes.io/dockerconfigjson @@ -129170,10 +136441,14 @@ def get_docker_credentials( } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129182,26 +136457,29 @@ def get_docker_credentials( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_docker_credentials_request( + _request = build_registry_get_docker_credentials_request( expiry_seconds=expiry_seconds, read_write=read_write, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129221,14 +136499,15 @@ def get_docker_credentials( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def validate_name( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Validate a Container Registry Name. To validate that a container registry name is available for use, send a POST @@ -129272,8 +136551,9 @@ def validate_name( @overload def validate_name( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Validate a Container Registry Name. To validate that a container registry name is available for use, send a POST @@ -129284,7 +136564,7 @@ def validate_name( be a 409 Conflict. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -129309,7 +136589,10 @@ def validate_name( """ @distributed_trace - def validate_name(self, body: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: + def validate_name( + self, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> Optional[JSON]: + # pylint: disable=line-too-long """Validate a Container Registry Name. To validate that a container registry name is available for use, send a POST @@ -129319,11 +136602,8 @@ def validate_name(self, body: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: be 204 and contain no body. If the name is already in use, the response will be a 409 Conflict. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -129331,6 +136611,13 @@ def validate_name(self, body: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str" # A globally unique name for the container registry. Must be + lowercase and be composed only of numbers, letters and ``-``"" , up to a limit of + 63 characters. Required. + } + # response body for status code(s): 409 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -129343,10 +136630,14 @@ def validate_name(self, body: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129355,38 +136646,41 @@ def validate_name(self, body: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_registry_validate_name_request( + _request = build_registry_validate_name_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 409]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -129419,14 +136713,15 @@ def validate_name(self, body: Union[JSON, IO], **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_repositories( self, registry_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Container Registry Repositories. This endpoint has been deprecated in favor of the *List All Container Registry Repositories @@ -129450,12 +136745,12 @@ def list_repositories( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "repositories": [ { "latest_tag": { @@ -129494,10 +136789,14 @@ def list_repositories( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129506,27 +136805,30 @@ def list_repositories( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_repositories_request( + _request = build_registry_list_repositories_request( registry_name=registry_name, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129563,9 +136865,9 @@ def list_repositories( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_repositories_v2( @@ -129577,6 +136879,7 @@ def list_repositories_v2( page_token: Optional[str] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Container Registry Repositories (V2). To list all repositories in your container registry, send a GET request to @@ -129601,12 +136904,12 @@ def list_repositories_v2( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "repositories": [ { "latest_manifest": { @@ -129657,10 +136960,14 @@ def list_repositories_v2( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129669,9 +136976,9 @@ def list_repositories_v2( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_repositories_v2_request( + _request = build_registry_list_repositories_v2_request( registry_name=registry_name, per_page=per_page, page=page, @@ -129679,18 +136986,21 @@ def list_repositories_v2( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129743,9 +137053,9 @@ def list_repositories_v2( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_repository_tags( @@ -129757,6 +137067,7 @@ def list_repository_tags( page: int = 1, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Container Registry Repository Tags. To list all tags in your container registry repository, send a GET @@ -129764,7 +137075,7 @@ def list_repository_tags( Note that if your repository name contains ``/`` characters, it must be URL-encoded in the request URL. For example, to list tags for - ``registry.digitalocean.com/example/my/repo``\ , the path would be + ``registry.digitalocean.com/example/my/repo``\\ , the path would be ``/v2/registry/example/repositories/my%2Frepo/tags``. :param registry_name: The name of a container registry. Required. @@ -129785,12 +137096,12 @@ def list_repository_tags( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "tags": [ { "compressed_size_bytes": 0, # Optional. The compressed size @@ -129821,10 +137132,14 @@ def list_repository_tags( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129833,9 +137148,9 @@ def list_repository_tags( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_repository_tags_request( + _request = build_registry_list_repository_tags_request( registry_name=registry_name, repository_name=repository_name, per_page=per_page, @@ -129843,18 +137158,21 @@ def list_repository_tags( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -129891,9 +137209,9 @@ def list_repository_tags( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_repository_tag( @@ -129903,6 +137221,7 @@ def delete_repository_tag( repository_tag: str, **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Container Registry Repository Tag. To delete a container repository tag, send a DELETE request to @@ -129910,7 +137229,7 @@ def delete_repository_tag( Note that if your repository name contains ``/`` characters, it must be URL-encoded in the request URL. For example, to delete - ``registry.digitalocean.com/example/my/repo:mytag``\ , the path would be + ``registry.digitalocean.com/example/my/repo:mytag``\\ , the path would be ``/v2/registry/example/repositories/my%2Frepo/tags/mytag``. A successful request will receive a 204 status code with no body in response. @@ -129942,10 +137261,14 @@ def delete_repository_tag( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -129954,27 +137277,30 @@ def delete_repository_tag( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_registry_delete_repository_tag_request( + _request = build_registry_delete_repository_tag_request( registry_name=registry_name, repository_name=repository_name, repository_tag=repository_tag, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -130007,9 +137333,9 @@ def delete_repository_tag( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_repository_manifests( @@ -130021,6 +137347,7 @@ def list_repository_manifests( page: int = 1, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Container Registry Repository Manifests. To list all manifests in your container registry repository, send a GET @@ -130028,7 +137355,7 @@ def list_repository_manifests( Note that if your repository name contains ``/`` characters, it must be URL-encoded in the request URL. For example, to list manifests for - ``registry.digitalocean.com/example/my/repo``\ , the path would be + ``registry.digitalocean.com/example/my/repo``\\ , the path would be ``/v2/registry/example/repositories/my%2Frepo/digests``. :param registry_name: The name of a container registry. Required. @@ -130049,6 +137376,9 @@ def list_repository_manifests( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "links": { "pages": {} }, @@ -130078,10 +137408,7 @@ def list_repository_manifests( "updated_at": "2020-02-20 00:00:00" # Optional. The time the manifest was last updated. } - ], - "meta": { - "total": 0 # Optional. Number of objects returned by the request. - } + ] } # response body for status code(s): 404 response == { @@ -130095,10 +137422,14 @@ def list_repository_manifests( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130107,9 +137438,9 @@ def list_repository_manifests( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_repository_manifests_request( + _request = build_registry_list_repository_manifests_request( registry_name=registry_name, repository_name=repository_name, per_page=per_page, @@ -130117,18 +137448,21 @@ def list_repository_manifests( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130165,9 +137499,9 @@ def list_repository_manifests( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_repository_manifest( @@ -130177,6 +137511,7 @@ def delete_repository_manifest( manifest_digest: str, **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete Container Registry Repository Manifest. To delete a container repository manifest by digest, send a DELETE request to @@ -130184,7 +137519,7 @@ def delete_repository_manifest( Note that if your repository name contains ``/`` characters, it must be URL-encoded in the request URL. For example, to delete - ``registry.digitalocean.com/example/my/repo@sha256:abcd``\ , the path would be + ``registry.digitalocean.com/example/my/repo@sha256:abcd``\\ , the path would be ``/v2/registry/example/repositories/my%2Frepo/digests/sha256:abcd``. A successful request will receive a 204 status code with no body in response. @@ -130216,10 +137551,14 @@ def delete_repository_manifest( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130228,27 +137567,30 @@ def delete_repository_manifest( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_registry_delete_repository_manifest_request( + _request = build_registry_delete_repository_manifest_request( registry_name=registry_name, repository_name=repository_name, manifest_digest=manifest_digest, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -130281,12 +137623,13 @@ def delete_repository_manifest( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def run_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Start Garbage Collection. Garbage collection enables users to clear out unreferenced blobs (layer & @@ -130355,10 +137698,14 @@ def run_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130367,25 +137714,28 @@ def run_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_run_garbage_collection_request( + _request = build_registry_run_garbage_collection_request( registry_name=registry_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130422,12 +137772,13 @@ def run_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Get Active Garbage Collection. To get information about the currently-active garbage collection for a registry, send a GET @@ -130475,10 +137826,14 @@ def get_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130487,25 +137842,28 @@ def get_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_garbage_collection_request( + _request = build_registry_get_garbage_collection_request( registry_name=registry_name, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130542,14 +137900,15 @@ def get_garbage_collection(self, registry_name: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_garbage_collections( self, registry_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Garbage Collections. To get information about past garbage collections for a registry, send a GET request to @@ -130603,10 +137962,14 @@ def list_garbage_collections( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130615,27 +137978,30 @@ def list_garbage_collections( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_list_garbage_collections_request( + _request = build_registry_list_garbage_collections_request( registry_name=registry_name, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130672,9 +138038,9 @@ def list_garbage_collections( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_garbage_collection( @@ -130686,6 +138052,7 @@ def update_garbage_collection( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Garbage Collection. To cancel the currently-active garbage collection for a registry, send a PUT request to @@ -130753,11 +138120,12 @@ def update_garbage_collection( self, registry_name: str, garbage_collection_uuid: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Garbage Collection. To cancel the currently-active garbage collection for a registry, send a PUT request to @@ -130769,7 +138137,7 @@ def update_garbage_collection( :param garbage_collection_uuid: The UUID of a garbage collection run. Required. :type garbage_collection_uuid: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -130819,9 +138187,10 @@ def update_garbage_collection( self, registry_name: str, garbage_collection_uuid: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update Garbage Collection. To cancel the currently-active garbage collection for a registry, send a PUT request to @@ -130832,11 +138201,8 @@ def update_garbage_collection( :type registry_name: str :param garbage_collection_uuid: The UUID of a garbage collection run. Required. :type garbage_collection_uuid: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -130844,6 +138210,12 @@ def update_garbage_collection( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "cancel": bool # Optional. A boolean value indicating that the garbage + collection should be cancelled. + } + # response body for status code(s): 200 response == { "garbage_collection": { @@ -130877,10 +138249,14 @@ def update_garbage_collection( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -130889,20 +138265,20 @@ def update_garbage_collection( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_registry_update_garbage_collection_request( + _request = build_registry_update_garbage_collection_request( registry_name=registry_name, garbage_collection_uuid=garbage_collection_uuid, content_type=content_type, @@ -130911,18 +138287,21 @@ def update_garbage_collection( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -130959,12 +138338,13 @@ def update_garbage_collection( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_options(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List Registry Options (Subscription Tiers and Available Regions). This endpoint serves to provide additional information as to which option values are available @@ -131024,10 +138404,14 @@ def get_options(self, **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131036,24 +138420,27 @@ def get_options(self, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_registry_get_options_request( + _request = build_registry_get_options_request( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131073,9 +138460,9 @@ def get_options(self, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class ReservedIPsOperations: @@ -131099,6 +138486,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Reserved IPs. To list all of the reserved IPs available on your account, send a GET request to @@ -131117,12 +138505,12 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "reserved_ips": [ { "droplet": {}, @@ -131152,10 +138540,14 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131164,26 +138556,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_reserved_ips_list_request( + _request = build_reserved_ips_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131203,14 +138598,15 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Reserved IP. On creation, a reserved IP must be either assigned to a Droplet or reserved to a region. @@ -131224,8 +138620,8 @@ def create( To create a new reserved IP reserved to a region, send a POST request to ``/v2/reserved_ips`` with the ``region`` attribute. - **Note**\ : In addition to the standard rate limiting, only 12 reserved IPs may be created per - 60 seconds. + **Note**\\ : In addition to the standard rate limiting, only 12 reserved IPs may be created + per 60 seconds. :param body: Required. :type body: JSON @@ -131295,8 +138691,9 @@ def create( @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Reserved IP. On creation, a reserved IP must be either assigned to a Droplet or reserved to a region. @@ -131310,11 +138707,11 @@ def create( To create a new reserved IP reserved to a region, send a POST request to ``/v2/reserved_ips`` with the ``region`` attribute. - **Note**\ : In addition to the standard rate limiting, only 12 reserved IPs may be created per - 60 seconds. + **Note**\\ : In addition to the standard rate limiting, only 12 reserved IPs may be created + per 60 seconds. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -131377,7 +138774,8 @@ def create( """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Reserved IP. On creation, a reserved IP must be either assigned to a Droplet or reserved to a region. @@ -131391,14 +138789,11 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: To create a new reserved IP reserved to a region, send a POST request to ``/v2/reserved_ips`` with the ``region`` attribute. - **Note**\ : In addition to the standard rate limiting, only 12 reserved IPs may be created per - 60 seconds. + **Note**\\ : In addition to the standard rate limiting, only 12 reserved IPs may be created + per 60 seconds. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -131406,6 +138801,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 202 response == { "links": { @@ -131456,10 +138854,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131468,38 +138870,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_reserved_ips_create_request( + _request = build_reserved_ips_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131519,12 +138924,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, reserved_ip: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Reserved IP. To show information about a reserved IP, send a GET request to @@ -131578,10 +138984,14 @@ def get(self, reserved_ip: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131590,25 +139000,28 @@ def get(self, reserved_ip: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_reserved_ips_get_request( + _request = build_reserved_ips_get_request( reserved_ip=reserved_ip, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131645,12 +139058,13 @@ def get(self, reserved_ip: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, reserved_ip: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Reserved IP. To delete a reserved IP and remove it from your account, send a DELETE request @@ -131680,10 +139094,14 @@ def delete(self, reserved_ip: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131692,25 +139110,28 @@ def delete(self, reserved_ip: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_reserved_ips_delete_request( + _request = build_reserved_ips_delete_request( reserved_ip=reserved_ip, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -131743,9 +139164,9 @@ def delete(self, reserved_ip: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class ReservedIPsActionsOperations: @@ -131769,6 +139190,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, reserved_ip: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Actions for a Reserved IP. To retrieve all actions that have been executed on a reserved IP, send a GET request to @@ -131785,6 +139207,9 @@ def list(self, reserved_ip: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -131826,9 +139251,6 @@ def list(self, reserved_ip: str, **kwargs: Any) -> JSON: ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -131843,10 +139265,14 @@ def list(self, reserved_ip: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -131855,25 +139281,28 @@ def list(self, reserved_ip: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_reserved_ips_actions_list_request( + _request = build_reserved_ips_actions_list_request( reserved_ip=reserved_ip, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -131910,9 +139339,9 @@ def list(self, reserved_ip: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def post( @@ -131923,6 +139352,7 @@ def post( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate a Reserved IP Action. To initiate an action on a reserved IP send a POST request to @@ -132014,11 +139444,12 @@ def post( def post( self, reserved_ip: str, - body: Optional[IO] = None, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate a Reserved IP Action. To initiate an action on a reserved IP send a POST request to @@ -132039,7 +139470,7 @@ def post( :type reserved_ip: str :param body: The ``type`` attribute set in the request body will specify the action that will be taken on the reserved IP. Default value is None. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -132105,8 +139536,12 @@ def post( @distributed_trace def post( - self, reserved_ip: str, body: Optional[Union[JSON, IO]] = None, **kwargs: Any + self, + reserved_ip: str, + body: Optional[Union[JSON, IO[bytes]]] = None, + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate a Reserved IP Action. To initiate an action on a reserved IP send a POST request to @@ -132126,11 +139561,9 @@ def post( :param reserved_ip: A reserved IP address. Required. :type reserved_ip: str :param body: The ``type`` attribute set in the request body will specify the action that - will be taken on the reserved IP. Is either a model type or a IO type. Default value is None. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + will be taken on the reserved IP. Is either a JSON type or a IO[bytes] type. Default value is + None. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -132138,6 +139571,9 @@ def post( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "action": { @@ -132190,10 +139626,14 @@ def post( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132202,15 +139642,15 @@ def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -132218,7 +139658,7 @@ def post( else: _json = None - request = build_reserved_ips_actions_post_request( + _request = build_reserved_ips_actions_post_request( reserved_ip=reserved_ip, content_type=content_type, json=_json, @@ -132226,18 +139666,21 @@ def post( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132274,12 +139717,13 @@ def post( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, reserved_ip: str, action_id: int, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Reserved IP Action. To retrieve the status of a reserved IP action, send a GET request to @@ -132349,10 +139793,14 @@ def get(self, reserved_ip: str, action_id: int, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132361,26 +139809,29 @@ def get(self, reserved_ip: str, action_id: int, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_reserved_ips_actions_get_request( + _request = build_reserved_ips_actions_get_request( reserved_ip=reserved_ip, action_id=action_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132417,9 +139868,9 @@ def get(self, reserved_ip: str, action_id: int, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class SizesOperations: @@ -132443,6 +139894,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Droplet Sizes. To list all of available Droplet sizes, send a GET request to ``/v2/sizes``. @@ -132462,9 +139914,6 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, @@ -132498,13 +139947,20 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: "vcpus": 0 # The integer of number CPUs allocated to Droplets of this size. Required. } - ] + ], + "links": { + "pages": {} + } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132513,26 +139969,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_sizes_list_request( + _request = build_sizes_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132552,9 +140011,9 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class SnapshotsOperations: @@ -132585,6 +140044,7 @@ def list( resource_type: Optional[str] = None, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Snapshots. To list all of the snapshots available on your account, send a GET request to @@ -132627,12 +140087,12 @@ def list( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "snapshots": [ { "created_at": "2020-02-20 00:00:00", # A time value given in @@ -132662,10 +140122,14 @@ def list( ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132674,27 +140138,30 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_snapshots_list_request( + _request = build_snapshots_list_request( per_page=per_page, page=page, resource_type=resource_type, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132714,12 +140181,13 @@ def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Snapshot. To retrieve information about a snapshot, send a GET request to @@ -132776,10 +140244,14 @@ def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132788,25 +140260,28 @@ def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_snapshots_get_request( + _request = build_snapshots_get_request( snapshot_id=snapshot_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -132859,12 +140334,13 @@ def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Snapshot. Both Droplet and volume snapshots are managed through the ``/v2/snapshots/`` @@ -132896,10 +140372,14 @@ def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -132908,25 +140388,28 @@ def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_snapshots_delete_request( + _request = build_snapshots_delete_request( snapshot_id=snapshot_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -132975,9 +140458,9 @@ def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class TagsOperations: @@ -133001,6 +140484,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Tags. To list all of your tags, you can send a GET request to ``/v2/tags``. @@ -133018,23 +140502,23 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "tags": [ { "name": "str", # Optional. The name of the tag. Tags may - contain letters, numbers, colons, dashes, and underscores."nThere is a - limit of 255 characters per tag."n"n**Note:** Tag names are case stable, + contain letters, numbers, colons, dashes, and underscores. There is a + limit of 255 characters per tag. **Note:** Tag names are case stable, which means the capitalization you use when you first create a tag is - canonical."n"nWhen working with tags in the API, you must use the tag's + canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will always display the canonical capitalization. For example, if you create a tag named "PROD", you can tag resources in the control panel by entering "prod". The tag will still display with its canonical @@ -133079,10 +140563,14 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -133091,26 +140579,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_tags_list_request( + _request = build_tags_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -133130,14 +140621,15 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Tag. To create a tag you can send a POST request to ``/v2/tags`` with a ``name`` attribute. @@ -133157,13 +140649,13 @@ def create( # JSON input template you can fill out and use as your body input. body = { "name": "str", # Optional. The name of the tag. Tags may contain letters, - numbers, colons, dashes, and underscores."nThere is a limit of 255 characters per - tag."n"n**Note:** Tag names are case stable, which means the capitalization you - use when you first create a tag is canonical."n"nWhen working with tags in the - API, you must use the tag's canonical capitalization. For example, if you create - a tag named "PROD", the URL to add that tag to a resource would be + numbers, colons, dashes, and underscores. There is a limit of 255 characters per + tag. **Note:** Tag names are case stable, which means the capitalization you use + when you first create a tag is canonical. When working with tags in the API, you + must use the tag's canonical capitalization. For example, if you create a tag + named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel will + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will always display the canonical capitalization. For example, if you create a tag named "PROD", you can tag resources in the control panel by entering "prod". The tag will still display with its canonical capitalization, "PROD". @@ -133209,17 +140701,17 @@ def create( response == { "tag": { "name": "str", # Optional. The name of the tag. Tags may contain - letters, numbers, colons, dashes, and underscores."nThere is a limit of 255 - characters per tag."n"n**Note:** Tag names are case stable, which means the - capitalization you use when you first create a tag is canonical."n"nWhen + letters, numbers, colons, dashes, and underscores. There is a limit of 255 + characters per tag. **Note:** Tag names are case stable, which means the + capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel - will always display the canonical capitalization. For example, if you create - a tag named "PROD", you can tag resources in the control panel by entering - "prod". The tag will still display with its canonical capitalization, "PROD". + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". + The tag will still display with its canonical capitalization, "PROD". "resources": { "count": 0, # Optional. The number of tagged objects for this type of resource. @@ -133261,26 +140753,27 @@ def create( # response body for status code(s): 400 response == { "error": "str", # A message providing information about the error. Required. - "messages": [ - "str" # Optional. A list of error messages. - ], "root_causes": [ "str" # A list of underlying causes for the error, including details to help resolve it when possible. Required. + ], + "messages": [ + "str" # Optional. A list of error messages. ] } """ @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Tag. To create a tag you can send a POST request to ``/v2/tags`` with a ``name`` attribute. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -133295,17 +140788,17 @@ def create( response == { "tag": { "name": "str", # Optional. The name of the tag. Tags may contain - letters, numbers, colons, dashes, and underscores."nThere is a limit of 255 - characters per tag."n"n**Note:** Tag names are case stable, which means the - capitalization you use when you first create a tag is canonical."n"nWhen + letters, numbers, colons, dashes, and underscores. There is a limit of 255 + characters per tag. **Note:** Tag names are case stable, which means the + capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel - will always display the canonical capitalization. For example, if you create - a tag named "PROD", you can tag resources in the control panel by entering - "prod". The tag will still display with its canonical capitalization, "PROD". + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". + The tag will still display with its canonical capitalization, "PROD". "resources": { "count": 0, # Optional. The number of tagged objects for this type of resource. @@ -133347,27 +140840,25 @@ def create( # response body for status code(s): 400 response == { "error": "str", # A message providing information about the error. Required. - "messages": [ - "str" # Optional. A list of error messages. - ], "root_causes": [ "str" # A list of underlying causes for the error, including details to help resolve it when possible. Required. + ], + "messages": [ + "str" # Optional. A list of error messages. ] } """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Tag. To create a tag you can send a POST request to ``/v2/tags`` with a ``name`` attribute. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -133375,21 +140866,72 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # Optional. The name of the tag. Tags may contain letters, + numbers, colons, dashes, and underscores. There is a limit of 255 characters per + tag. **Note:** Tag names are case stable, which means the capitalization you use + when you first create a tag is canonical. When working with tags in the API, you + must use the tag's canonical capitalization. For example, if you create a tag + named "PROD", the URL to add that tag to a resource would be + ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". The + tag will still display with its canonical capitalization, "PROD". + "resources": { + "count": 0, # Optional. The number of tagged objects for this type + of resource. + "databases": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + }, + "droplets": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + }, + "imgages": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + }, + "last_tagged_uri": "str", # Optional. The URI for the last tagged + object for this type of resource. + "volume_snapshots": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + }, + "volumes": { + "count": 0, # Optional. The number of tagged objects for + this type of resource. + "last_tagged_uri": "str" # Optional. The URI for the last + tagged object for this type of resource. + } + } + } + # response body for status code(s): 201 response == { "tag": { "name": "str", # Optional. The name of the tag. Tags may contain - letters, numbers, colons, dashes, and underscores."nThere is a limit of 255 - characters per tag."n"n**Note:** Tag names are case stable, which means the - capitalization you use when you first create a tag is canonical."n"nWhen + letters, numbers, colons, dashes, and underscores. There is a limit of 255 + characters per tag. **Note:** Tag names are case stable, which means the + capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel - will always display the canonical capitalization. For example, if you create - a tag named "PROD", you can tag resources in the control panel by entering - "prod". The tag will still display with its canonical capitalization, "PROD". + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". + The tag will still display with its canonical capitalization, "PROD". "resources": { "count": 0, # Optional. The number of tagged objects for this type of resource. @@ -133431,19 +140973,23 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: # response body for status code(s): 400 response == { "error": "str", # A message providing information about the error. Required. - "messages": [ - "str" # Optional. A list of error messages. - ], "root_causes": [ "str" # A list of underlying causes for the error, including details to help resolve it when possible. Required. + ], + "messages": [ + "str" # Optional. A list of error messages. ] } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -133452,38 +140998,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_tags_create_request( + _request = build_tags_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 400]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -133523,12 +141072,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, tag_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve a Tag. To retrieve an individual tag, you can send a ``GET`` request to ``/v2/tags/$TAG_NAME``. @@ -133547,17 +141097,17 @@ def get(self, tag_id: str, **kwargs: Any) -> JSON: response == { "tag": { "name": "str", # Optional. The name of the tag. Tags may contain - letters, numbers, colons, dashes, and underscores."nThere is a limit of 255 - characters per tag."n"n**Note:** Tag names are case stable, which means the - capitalization you use when you first create a tag is canonical."n"nWhen + letters, numbers, colons, dashes, and underscores. There is a limit of 255 + characters per tag. **Note:** Tag names are case stable, which means the + capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag's canonical capitalization. For example, if you create a tag named "PROD", the URL to add that tag to a resource would be ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not - ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel - will always display the canonical capitalization. For example, if you create - a tag named "PROD", you can tag resources in the control panel by entering - "prod". The tag will still display with its canonical capitalization, "PROD". + ``/v2/tags/prod/resources``"" ). Tagged resources in the control panel will + always display the canonical capitalization. For example, if you create a tag + named "PROD", you can tag resources in the control panel by entering "prod". + The tag will still display with its canonical capitalization, "PROD". "resources": { "count": 0, # Optional. The number of tagged objects for this type of resource. @@ -133608,10 +141158,14 @@ def get(self, tag_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -133620,25 +141174,28 @@ def get(self, tag_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_tags_get_request( + _request = build_tags_get_request( tag_id=tag_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -133675,12 +141232,13 @@ def get(self, tag_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, tag_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Tag. A tag can be deleted by sending a ``DELETE`` request to ``/v2/tags/$TAG_NAME``. Deleting a tag @@ -133708,10 +141266,14 @@ def delete(self, tag_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -133720,25 +141282,28 @@ def delete(self, tag_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_tags_delete_request( + _request = build_tags_delete_request( tag_id=tag_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -133771,9 +141336,9 @@ def delete(self, tag_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def assign_resources( @@ -133784,14 +141349,15 @@ def assign_resources( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Tag a Resource. Resources can be tagged by sending a POST request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. @@ -133837,25 +141403,26 @@ def assign_resources( def assign_resources( self, tag_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Tag a Resource. Resources can be tagged by sending a POST request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. :type tag_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -133881,25 +141448,23 @@ def assign_resources( @distributed_trace def assign_resources( - self, tag_id: str, body: Union[JSON, IO], **kwargs: Any + self, tag_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Tag a Resource. Resources can be tagged by sending a POST request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. :type tag_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -133907,6 +141472,18 @@ def assign_resources( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "resources": [ + { + "resource_id": "str", # Optional. The identifier of a + resource. + "resource_type": "str" # Optional. The type of the resource. + Known values are: "droplet", "image", "volume", and "volume_snapshot". + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -133919,10 +141496,14 @@ def assign_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -133931,20 +141512,20 @@ def assign_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_tags_assign_resources_request( + _request = build_tags_assign_resources_request( tag_id=tag_id, content_type=content_type, json=_json, @@ -133952,18 +141533,21 @@ def assign_resources( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -133996,9 +141580,9 @@ def assign_resources( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @overload def unassign_resources( @@ -134009,14 +141593,15 @@ def unassign_resources( content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Untag a Resource. Resources can be untagged by sending a DELETE request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. @@ -134062,25 +141647,26 @@ def unassign_resources( def unassign_resources( self, tag_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> Optional[JSON]: + # pylint: disable=line-too-long """Untag a Resource. Resources can be untagged by sending a DELETE request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. :type tag_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -134106,25 +141692,23 @@ def unassign_resources( @distributed_trace def unassign_resources( - self, tag_id: str, body: Union[JSON, IO], **kwargs: Any + self, tag_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Untag a Resource. Resources can be untagged by sending a DELETE request to ``/v2/tags/$TAG_NAME/resources`` with an array of json objects containing ``resource_id`` and ``resource_type`` attributes. Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is - supported. ``resource_type`` is expected to be the string ``droplet``\ , ``database``\ , - ``image``\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of the - resource as a string. + supported. ``resource_type`` is expected to be the string ``droplet``\\ , ``database``\\ , + ``image``\\ , ``volume`` or ``volume_snapshot``. ``resource_id`` is expected to be the ID of + the resource as a string. :param tag_id: The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required. :type tag_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: @@ -134132,6 +141716,18 @@ def unassign_resources( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "resources": [ + { + "resource_id": "str", # Optional. The identifier of a + resource. + "resource_type": "str" # Optional. The type of the resource. + Known values are: "droplet", "image", "volume", and "volume_snapshot". + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code @@ -134144,10 +141740,14 @@ def unassign_resources( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -134156,20 +141756,20 @@ def unassign_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + ) + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_tags_unassign_resources_request( + _request = build_tags_unassign_resources_request( tag_id=tag_id, content_type=content_type, json=_json, @@ -134177,18 +141777,21 @@ def unassign_resources( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -134221,9 +141824,9 @@ def unassign_resources( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class VolumesOperations: @@ -134255,6 +141858,7 @@ def list( page: int = 1, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List All Block Storage Volumes. To list all of the block storage volumes available on your account, send a GET request to @@ -134302,9 +141906,6 @@ def list( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, @@ -134354,13 +141955,20 @@ def list( existing or new tags. ] } - ] + ], + "links": { + "pages": {} + } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -134369,9 +141977,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volumes_list_request( + _request = build_volumes_list_request( name=name, region=region, per_page=per_page, @@ -134379,18 +141987,21 @@ def list( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -134410,14 +142021,15 @@ def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Block Storage Volume. To create a new volume, send a POST request to ``/v2/volumes``. Optionally, a @@ -134502,8 +142114,9 @@ def create( @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Block Storage Volume. To create a new volume, send a POST request to ``/v2/volumes``. Optionally, a @@ -134513,7 +142126,7 @@ def create( pre-formatted volumes to Droplets without support for auto-mounting is not recommended. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -134584,7 +142197,8 @@ def create( """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Block Storage Volume. To create a new volume, send a POST request to ``/v2/volumes``. Optionally, a @@ -134593,11 +142207,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -134605,6 +142216,9 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 201 response == { "volume": { @@ -134663,10 +142277,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -134675,38 +142293,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_volumes_create_request( + _request = build_volumes_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -134759,14 +142380,15 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_by_name( self, *, name: Optional[str] = None, region: Optional[str] = None, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Block Storage Volume by Name. Block storage volumes may also be deleted by name by sending a DELETE request with the volume's @@ -134801,10 +142423,14 @@ def delete_by_name( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -134813,26 +142439,29 @@ def delete_by_name( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_volumes_delete_by_name_request( + _request = build_volumes_delete_by_name_request( name=name, region=region, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -134865,12 +142494,13 @@ def delete_by_name( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get(self, volume_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Block Storage Volume. To show information about a block storage volume, send a GET request to @@ -134943,10 +142573,14 @@ def get(self, volume_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -134955,25 +142589,28 @@ def get(self, volume_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volumes_get_request( + _request = build_volumes_get_request( volume_id=volume_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -135010,12 +142647,13 @@ def get(self, volume_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, volume_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Block Storage Volume. To delete a block storage volume, destroying all data and removing it from your account, send a @@ -135045,10 +142683,14 @@ def delete(self, volume_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -135057,25 +142699,28 @@ def delete(self, volume_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_volumes_delete_request( + _request = build_volumes_delete_request( volume_id=volume_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -135108,9 +142753,9 @@ def delete(self, volume_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore class VolumeActionsOperations: @@ -135142,6 +142787,7 @@ def post( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Name. To initiate an action on a block storage volume by Name, send a POST request to @@ -135263,13 +142909,14 @@ def post( @overload def post( self, - body: IO, + body: IO[bytes], *, per_page: int = 20, page: int = 1, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Name. To initiate an action on a block storage volume by Name, send a POST request to @@ -135320,7 +142967,7 @@ def post( - Set to the slug representing the region where the volume is located. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword per_page: Number of items returned per page. Default value is 20. :paramtype per_page: int :keyword page: Which 'page' of paginated results to return. Default value is 1. @@ -135387,8 +143034,14 @@ def post( @distributed_trace def post( - self, body: Union[JSON, IO], *, per_page: int = 20, page: int = 1, **kwargs: Any + self, + body: Union[JSON, IO[bytes]], + *, + per_page: int = 20, + page: int = 1, + **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Name. To initiate an action on a block storage volume by Name, send a POST request to @@ -135438,15 +143091,12 @@ def post( * - region - Set to the slug representing the region where the volume is located. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword per_page: Number of items returned per page. Default value is 20. :paramtype per_page: int :keyword page: Which 'page' of paginated results to return. Default value is 1. :paramtype page: int - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -135454,6 +143104,9 @@ def post( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 202 response == { "action": { @@ -135503,10 +143156,14 @@ def post( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -135515,20 +143172,20 @@ def post( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_volume_actions_post_request( + _request = build_volume_actions_post_request( per_page=per_page, page=page, content_type=content_type, @@ -135537,18 +143194,21 @@ def post( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -135585,14 +143245,15 @@ def post( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list( self, volume_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Actions for a Volume. To retrieve all actions that have been executed on a volume, send a GET request to @@ -135613,6 +143274,9 @@ def list( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "actions": [ { "completed_at": "2020-02-20 00:00:00", # Optional. A time @@ -135653,9 +143317,6 @@ def list( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -135670,10 +143331,14 @@ def list( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -135682,27 +143347,30 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volume_actions_list_request( + _request = build_volume_actions_list_request( volume_id=volume_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -135739,9 +143407,9 @@ def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def post_by_id( @@ -135754,6 +143422,7 @@ def post_by_id( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Id. To initiate an action on a block storage volume by Id, send a POST request to @@ -135893,13 +143562,14 @@ def post_by_id( def post_by_id( self, volume_id: str, - body: IO, + body: IO[bytes], *, per_page: int = 20, page: int = 1, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Id. To initiate an action on a block storage volume by Id, send a POST request to @@ -135967,7 +143637,7 @@ def post_by_id( :param volume_id: The ID of the block storage volume. Required. :type volume_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword per_page: Number of items returned per page. Default value is 20. :paramtype per_page: int :keyword page: Which 'page' of paginated results to return. Default value is 1. @@ -136036,12 +143706,13 @@ def post_by_id( def post_by_id( self, volume_id: str, - body: Union[JSON, IO], + body: Union[JSON, IO[bytes]], *, per_page: int = 20, page: int = 1, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Initiate A Block Storage Action By Volume Id. To initiate an action on a block storage volume by Id, send a POST request to @@ -136108,15 +143779,12 @@ def post_by_id( :param volume_id: The ID of the block storage volume. Required. :type volume_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :keyword per_page: Number of items returned per page. Default value is 20. :paramtype per_page: int :keyword page: Which 'page' of paginated results to return. Default value is 1. :paramtype page: int - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -136124,6 +143792,9 @@ def post_by_id( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = {} + # response body for status code(s): 202 response == { "action": { @@ -136173,10 +143844,14 @@ def post_by_id( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -136185,20 +143860,20 @@ def post_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_volume_actions_post_by_id_request( + _request = build_volume_actions_post_by_id_request( volume_id=volume_id, per_page=per_page, page=page, @@ -136208,18 +143883,21 @@ def post_by_id( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -136256,9 +143934,9 @@ def post_by_id( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get( @@ -136270,6 +143948,7 @@ def get( page: int = 1, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Volume Action. To retrieve the status of a volume action, send a GET request to @@ -136340,10 +144019,14 @@ def get( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -136352,9 +144035,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volume_actions_get_request( + _request = build_volume_actions_get_request( volume_id=volume_id, action_id=action_id, per_page=per_page, @@ -136362,18 +144045,21 @@ def get( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -136410,9 +144096,9 @@ def get( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class VolumeSnapshotsOperations: @@ -136436,6 +144122,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Volume Snapshot. To retrieve the details of a snapshot that has been created from a volume, send a GET request @@ -136488,10 +144175,14 @@ def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -136500,25 +144191,28 @@ def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volume_snapshots_get_by_id_request( + _request = build_volume_snapshots_get_by_id_request( snapshot_id=snapshot_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -136555,12 +144249,13 @@ def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Volume Snapshot. To delete a volume snapshot, send a DELETE request to @@ -136590,10 +144285,14 @@ def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -136602,25 +144301,28 @@ def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_volume_snapshots_delete_by_id_request( + _request = build_volume_snapshots_delete_by_id_request( snapshot_id=snapshot_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -136653,14 +144355,15 @@ def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list( self, volume_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List Snapshots for a Volume. To retrieve the snapshots that have been created from a volume, send a GET request to @@ -136681,12 +144384,12 @@ def list( # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "snapshots": [ { "created_at": "2020-02-20 00:00:00", # A time value given in @@ -136727,10 +144430,14 @@ def list( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -136739,27 +144446,30 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_volume_snapshots_list_request( + _request = build_volume_snapshots_list_request( volume_id=volume_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -136796,9 +144506,9 @@ def list( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( @@ -136809,6 +144519,7 @@ def create( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create Snapshot from a Volume. To create a snapshot from a volume, sent a POST request to @@ -136880,11 +144591,12 @@ def create( def create( self, volume_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create Snapshot from a Volume. To create a snapshot from a volume, sent a POST request to @@ -136893,7 +144605,7 @@ def create( :param volume_id: The ID of the block storage volume. Required. :type volume_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -136944,7 +144656,10 @@ def create( """ @distributed_trace - def create(self, volume_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create( + self, volume_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Create Snapshot from a Volume. To create a snapshot from a volume, sent a POST request to @@ -136952,11 +144667,8 @@ def create(self, volume_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: :param volume_id: The ID of the block storage volume. Required. :type volume_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -136964,6 +144676,15 @@ def create(self, volume_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # A human-readable name for the volume snapshot. Required. + "tags": [ + "str" # Optional. A flat array of tag names as strings to be applied + to the resource. Tag names may be for either existing or new tags. + ] + } + # response body for status code(s): 201 response == { "snapshot": { @@ -137002,10 +144723,14 @@ def create(self, volume_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -137014,20 +144739,20 @@ def create(self, volume_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_volume_snapshots_create_request( + _request = build_volume_snapshots_create_request( volume_id=volume_id, content_type=content_type, json=_json, @@ -137035,18 +144760,21 @@ def create(self, volume_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 400, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -137099,9 +144827,9 @@ def create(self, volume_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class VpcsOperations: @@ -137125,6 +144853,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All VPCs. To list all of the VPCs on your account, send a GET request to ``/v2/vpcs``. @@ -137142,12 +144871,12 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "links": { - "pages": {} - }, "meta": { "total": 0 # Optional. Number of objects returned by the request. }, + "links": { + "pages": {} + }, "vpcs": [ { "created_at": "2020-02-20 00:00:00", # Optional. A time @@ -137191,10 +144920,14 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -137203,26 +144936,29 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_vpcs_list_request( + _request = build_vpcs_list_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -137259,14 +144995,15 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New VPC. To create a VPC, send a POST request to ``/v2/vpcs`` specifying the attributes @@ -137338,8 +145075,9 @@ def create( @overload def create( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New VPC. To create a VPC, send a POST request to ``/v2/vpcs`` specifying the attributes @@ -137350,7 +145088,7 @@ def create( region. The default VPC for a region cannot be changed or deleted. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -137394,7 +145132,8 @@ def create( """ @distributed_trace - def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New VPC. To create a VPC, send a POST request to ``/v2/vpcs`` specifying the attributes @@ -137404,11 +145143,8 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: region, the first one that you create will be set as the default for that region. The default VPC for a region cannot be changed or deleted. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -137416,6 +145152,22 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "description": "str", # Optional. A free-form text field for describing the + VPC's purpose. It may be a maximum of 255 characters. + "ip_range": "str", # Optional. The range of IP addresses in the VPC in CIDR + notation. Network ranges cannot overlap with other networks in the same account + and must be in range of private addresses as defined in RFC1918. It may not be + smaller than ``/28`` nor larger than ``/16``. If no IP range is specified, a + ``/20`` network range is generated that won't conflict with other VPC networks in + your account. + "name": "str", # Optional. The name of the VPC. Must be unique and may only + contain alphanumeric characters, dashes, and periods. + "region": "str" # Optional. The slug identifier for the region where the VPC + will be created. + } + # response body for status code(s): 201 response == { "vpc": { @@ -137447,10 +145199,14 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -137459,38 +145215,41 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_vpcs_create_request( + _request = build_vpcs_create_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -137510,12 +145269,13 @@ def create(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get(self, vpc_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing VPC. To show information about an existing VPC, send a GET request to ``/v2/vpcs/$VPC_ID``. @@ -137571,10 +145331,14 @@ def get(self, vpc_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -137583,25 +145347,28 @@ def get(self, vpc_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_vpcs_get_request( + _request = build_vpcs_get_request( vpc_id=vpc_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -137638,9 +145405,9 @@ def get(self, vpc_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update( @@ -137651,6 +145418,7 @@ def update( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a VPC. To update information about a VPC, send a PUT request to ``/v2/vpcs/$VPC_ID``. @@ -137731,11 +145499,12 @@ def update( def update( self, vpc_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a VPC. To update information about a VPC, send a PUT request to ``/v2/vpcs/$VPC_ID``. @@ -137743,7 +145512,7 @@ def update( :param vpc_id: A unique identifier for a VPC. Required. :type vpc_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -137798,18 +145567,16 @@ def update( """ @distributed_trace - def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def update(self, vpc_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Update a VPC. To update information about a VPC, send a PUT request to ``/v2/vpcs/$VPC_ID``. :param vpc_id: A unique identifier for a VPC. Required. :type vpc_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -137817,6 +145584,21 @@ def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "default": bool, # Optional. A boolean value indicating whether or not the + VPC is the default network for the region. All applicable resources are placed + into the default VPC network unless otherwise specified during their creation. + The ``default`` field cannot be unset from ``true``. If you want to set a new + default VPC network, update the ``default`` field of another VPC network in the + same region. The previous network's ``default`` field will be set to ``false`` + when a new default VPC has been defined. + "description": "str", # Optional. A free-form text field for describing the + VPC's purpose. It may be a maximum of 255 characters. + "name": "str" # Optional. The name of the VPC. Must be unique and may only + contain alphanumeric characters, dashes, and periods. + } + # response body for status code(s): 200 response == { "vpc": { @@ -137859,10 +145641,14 @@ def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -137871,20 +145657,20 @@ def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_vpcs_update_request( + _request = build_vpcs_update_request( vpc_id=vpc_id, content_type=content_type, json=_json, @@ -137892,18 +145678,21 @@ def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -137940,9 +145729,9 @@ def update(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def patch( @@ -137953,6 +145742,7 @@ def patch( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Partially Update a VPC. To update a subset of information about a VPC, send a PATCH request to @@ -138034,11 +145824,12 @@ def patch( def patch( self, vpc_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Partially Update a VPC. To update a subset of information about a VPC, send a PATCH request to @@ -138047,7 +145838,7 @@ def patch( :param vpc_id: A unique identifier for a VPC. Required. :type vpc_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -138102,7 +145893,8 @@ def patch( """ @distributed_trace - def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def patch(self, vpc_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Partially Update a VPC. To update a subset of information about a VPC, send a PATCH request to @@ -138110,11 +145902,8 @@ def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: :param vpc_id: A unique identifier for a VPC. Required. :type vpc_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -138122,6 +145911,21 @@ def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "default": bool, # Optional. A boolean value indicating whether or not the + VPC is the default network for the region. All applicable resources are placed + into the default VPC network unless otherwise specified during their creation. + The ``default`` field cannot be unset from ``true``. If you want to set a new + default VPC network, update the ``default`` field of another VPC network in the + same region. The previous network's ``default`` field will be set to ``false`` + when a new default VPC has been defined. + "description": "str", # Optional. A free-form text field for describing the + VPC's purpose. It may be a maximum of 255 characters. + "name": "str" # Optional. The name of the VPC. Must be unique and may only + contain alphanumeric characters, dashes, and periods. + } + # response body for status code(s): 200 response == { "vpc": { @@ -138164,10 +145968,14 @@ def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -138176,20 +145984,20 @@ def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_vpcs_patch_request( + _request = build_vpcs_patch_request( vpc_id=vpc_id, content_type=content_type, json=_json, @@ -138197,18 +146005,21 @@ def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -138245,12 +146056,13 @@ def patch(self, vpc_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete(self, vpc_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a VPC. To delete a VPC, send a DELETE request to ``/v2/vpcs/$VPC_ID``. A 204 status @@ -138282,10 +146094,14 @@ def delete(self, vpc_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -138294,25 +146110,28 @@ def delete(self, vpc_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_vpcs_delete_request( + _request = build_vpcs_delete_request( vpc_id=vpc_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -138345,9 +146164,9 @@ def delete(self, vpc_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def list_members( @@ -138359,6 +146178,7 @@ def list_members( page: int = 1, **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """List the Member Resources of a VPC. To list all of the resources that are members of a VPC, send a GET request to @@ -138385,6 +146205,9 @@ def list_members( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "links": { "pages": {} }, @@ -138397,10 +146220,7 @@ def list_members( "urn": "str" # Optional. The uniform resource name (URN) for the resource in the format do:resource_type:resource_id. } - ], - "meta": { - "total": 0 # Optional. Number of objects returned by the request. - } + ] } # response body for status code(s): 404 response == { @@ -138414,10 +146234,14 @@ def list_members( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -138426,9 +146250,9 @@ def list_members( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_vpcs_list_members_request( + _request = build_vpcs_list_members_request( vpc_id=vpc_id, resource_type=resource_type, per_page=per_page, @@ -138436,18 +146260,21 @@ def list_members( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -138484,9 +146311,9 @@ def list_members( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore class UptimeOperations: @@ -138510,6 +146337,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list_checks(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """List All Checks. To list all of the Uptime checks on your account, send a GET request to ``/v2/uptime/checks``. @@ -138527,6 +146355,9 @@ def list_checks(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JS # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "checks": [ { "enabled": True, # Optional. Default value is True. A @@ -138546,9 +146377,6 @@ def list_checks(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JS ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -138563,10 +146391,14 @@ def list_checks(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JS tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -138575,26 +146407,29 @@ def list_checks(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JS _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_list_checks_request( + _request = build_uptime_list_checks_request( per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -138631,14 +146466,15 @@ def list_checks(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JS deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_check( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Check. To create an Uptime check, send a POST request to ``/v2/uptime/checks`` specifying the @@ -138693,8 +146529,9 @@ def create_check( @overload def create_check( - self, body: IO, *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Create a New Check. To create an Uptime check, send a POST request to ``/v2/uptime/checks`` specifying the @@ -138702,7 +146539,7 @@ def create_check( in the table below in the JSON body. :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -138734,18 +146571,16 @@ def create_check( """ @distributed_trace - def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create_check(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Create a New Check. To create an Uptime check, send a POST request to ``/v2/uptime/checks`` specifying the attributes in the table below in the JSON body. - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -138753,6 +146588,20 @@ def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "enabled": True, # Optional. Default value is True. A boolean value + indicating whether the check is enabled/disabled. + "name": "str", # Optional. A human-friendly display name. + "regions": [ + "str" # Optional. An array containing the selected regions to + perform healthchecks from. + ], + "target": "str", # Optional. The endpoint to perform healthchecks on. + "type": "str" # Optional. The type of health check to perform. Known values + are: "ping", "http", and "https". + } + # response body for status code(s): 201 response == { "check": { @@ -138772,10 +146621,14 @@ def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: } } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -138784,38 +146637,41 @@ def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_uptime_create_check_request( + _request = build_uptime_create_check_request( content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -138835,12 +146691,13 @@ def create_check(self, body: Union[JSON, IO], **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_check(self, check_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Check. To show information about an existing check, send a GET request to @@ -138885,10 +146742,14 @@ def get_check(self, check_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -138897,25 +146758,28 @@ def get_check(self, check_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_get_check_request( + _request = build_uptime_get_check_request( check_id=check_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -138952,9 +146816,9 @@ def get_check(self, check_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_check( @@ -138965,6 +146829,7 @@ def update_check( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Check. To update the settings of an Uptime check, send a PUT request to @@ -139033,11 +146898,12 @@ def update_check( def update_check( self, check_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update a Check. To update the settings of an Uptime check, send a PUT request to @@ -139046,7 +146912,7 @@ def update_check( :param check_id: A unique identifier for a check. Required. :type check_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -139089,7 +146955,10 @@ def update_check( """ @distributed_trace - def update_check(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def update_check( + self, check_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Update a Check. To update the settings of an Uptime check, send a PUT request to @@ -139097,11 +146966,8 @@ def update_check(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J :param check_id: A unique identifier for a check. Required. :type check_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -139109,6 +146975,20 @@ def update_check(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "enabled": True, # Optional. Default value is True. A boolean value + indicating whether the check is enabled/disabled. + "name": "str", # Optional. A human-friendly display name. + "regions": [ + "str" # Optional. An array containing the selected regions to + perform healthchecks from. + ], + "target": "str", # Optional. The endpoint to perform healthchecks on. + "type": "str" # Optional. The type of health check to perform. Known values + are: "ping", "http", and "https". + } + # response body for status code(s): 200 response == { "check": { @@ -139139,10 +147019,14 @@ def update_check(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -139151,20 +147035,20 @@ def update_check(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_uptime_update_check_request( + _request = build_uptime_update_check_request( check_id=check_id, content_type=content_type, json=_json, @@ -139172,18 +147056,21 @@ def update_check(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -139220,12 +147107,13 @@ def update_check(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_check(self, check_id: str, **kwargs: Any) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete a Check. To delete an Uptime check, send a DELETE request to ``/v2/uptime/checks/$CHECK_ID``. A 204 @@ -139255,10 +147143,14 @@ def delete_check(self, check_id: str, **kwargs: Any) -> Optional[JSON]: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -139267,25 +147159,28 @@ def delete_check(self, check_id: str, **kwargs: Any) -> Optional[JSON]: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_uptime_delete_check_request( + _request = build_uptime_delete_check_request( check_id=check_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -139318,12 +147213,13 @@ def delete_check(self, check_id: str, **kwargs: Any) -> Optional[JSON]: deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore @distributed_trace def get_check_state(self, check_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve Check State. To show information about an existing check's state, send a GET request to @@ -139379,10 +147275,14 @@ def get_check_state(self, check_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -139391,25 +147291,28 @@ def get_check_state(self, check_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_get_check_state_request( + _request = build_uptime_get_check_state_request( check_id=check_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -139446,14 +147349,15 @@ def get_check_state(self, check_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_alerts( self, check_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """List All Alerts. To list all of the alerts for an Uptime check, send a GET request to @@ -139474,6 +147378,9 @@ def list_alerts( # response body for status code(s): 200 response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, "alerts": [ { "comparison": "str", # Optional. The comparison operator @@ -139509,9 +147416,6 @@ def list_alerts( ], "links": { "pages": {} - }, - "meta": { - "total": 0 # Optional. Number of objects returned by the request. } } # response body for status code(s): 404 @@ -139526,10 +147430,14 @@ def list_alerts( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -139538,27 +147446,30 @@ def list_alerts( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_list_alerts_request( + _request = build_uptime_list_alerts_request( check_id=check_id, per_page=per_page, page=page, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -139595,9 +147506,9 @@ def list_alerts( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def create_alert( @@ -139608,6 +147519,7 @@ def create_alert( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Alert. To create an Uptime alert, send a POST request to ``/v2/uptime/checks/$CHECK_ID/alerts`` @@ -139713,11 +147625,12 @@ def create_alert( def create_alert( self, check_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Create a New Alert. To create an Uptime alert, send a POST request to ``/v2/uptime/checks/$CHECK_ID/alerts`` @@ -139734,7 +147647,7 @@ def create_alert( ``down`` | alerts on a target registering as down in any region | N/A (Not required) ``down_global`` | alerts on a target registering as down globally | N/A (Not required) ``ssl_expiry`` | alerts on a SSL certificate expiring within $threshold days | days. Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -139791,7 +147704,10 @@ def create_alert( """ @distributed_trace - def create_alert(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create_alert( + self, check_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long """Create a New Alert. To create an Uptime alert, send a POST request to ``/v2/uptime/checks/$CHECK_ID/alerts`` @@ -139808,11 +147724,8 @@ def create_alert(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J ``down`` | alerts on a target registering as down in any region | N/A (Not required) ``down_global`` | alerts on a target registering as down globally | N/A (Not required) ``ssl_expiry`` | alerts on a SSL certificate expiring within $threshold days | days. Is either - a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -139820,6 +147733,35 @@ def create_alert(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "comparison": "str", # Optional. The comparison operator used against the + alert's threshold. Known values are: "greater_than" and "less_than". + "id": "str", # Optional. A unique ID that can be used to identify and + reference the alert. + "name": "str", # Optional. A human-friendly display name. + "notifications": { + "email": [ + "str" # An email to notify on an alert trigger. The Email + has to be one that is verified on that DigitalOcean account. Required. + ], + "slack": [ + { + "channel": "str", # Slack channel to notify of an + alert trigger. Required. + "url": "str" # Slack Webhook URL. Required. + } + ] + }, + "period": "str", # Optional. Period of time the threshold must be exceeded + to trigger the alert. Known values are: "2m", "3m", "5m", "10m", "15m", "30m", + and "1h". + "threshold": 0, # Optional. The threshold at which the alert will enter a + trigger state. The specific threshold is dependent on the alert type. + "type": "str" # Optional. The type of alert. Known values are: "latency", + "down", "down_global", and "ssl_expiry". + } + # response body for status code(s): 201 response == { "alert": { @@ -139864,10 +147806,14 @@ def create_alert(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -139876,20 +147822,20 @@ def create_alert(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_uptime_create_alert_request( + _request = build_uptime_create_alert_request( check_id=check_id, content_type=content_type, json=_json, @@ -139897,18 +147843,21 @@ def create_alert(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [201, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -139945,12 +147894,13 @@ def create_alert(self, check_id: str, body: Union[JSON, IO], **kwargs: Any) -> J deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_alert(self, check_id: str, alert_id: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long """Retrieve an Existing Alert. To show information about an existing alert, send a GET request to @@ -140011,10 +147961,14 @@ def get_alert(self, check_id: str, alert_id: str, **kwargs: Any) -> JSON: tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -140023,26 +147977,29 @@ def get_alert(self, check_id: str, alert_id: str, **kwargs: Any) -> JSON: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + cls: ClsType[JSON] = kwargs.pop("cls", None) - request = build_uptime_get_alert_request( + _request = build_uptime_get_alert_request( check_id=check_id, alert_id=alert_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -140079,9 +148036,9 @@ def get_alert(self, check_id: str, alert_id: str, **kwargs: Any) -> JSON: deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @overload def update_alert( @@ -140093,6 +148050,7 @@ def update_alert( content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update an Alert. To update the settings of an Uptime alert, send a PUT request to @@ -140191,11 +148149,12 @@ def update_alert( self, check_id: str, alert_id: str, - body: IO, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any, ) -> JSON: + # pylint: disable=line-too-long """Update an Alert. To update the settings of an Uptime alert, send a PUT request to @@ -140206,7 +148165,7 @@ def update_alert( :param alert_id: A unique identifier for an alert. Required. :type alert_id: str :param body: Required. - :type body: IO + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -140264,8 +148223,9 @@ def update_alert( @distributed_trace def update_alert( - self, check_id: str, alert_id: str, body: Union[JSON, IO], **kwargs: Any + self, check_id: str, alert_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any ) -> JSON: + # pylint: disable=line-too-long """Update an Alert. To update the settings of an Uptime alert, send a PUT request to @@ -140275,11 +148235,8 @@ def update_alert( :type check_id: str :param alert_id: A unique identifier for an alert. Required. :type alert_id: str - :param body: Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -140287,6 +148244,33 @@ def update_alert( Example: .. code-block:: python + # JSON input template you can fill out and use as your body input. + body = { + "comparison": "str", # Optional. The comparison operator used against the + alert's threshold. Known values are: "greater_than" and "less_than". + "name": "str", # Optional. A human-friendly display name. + "notifications": { + "email": [ + "str" # An email to notify on an alert trigger. The Email + has to be one that is verified on that DigitalOcean account. Required. + ], + "slack": [ + { + "channel": "str", # Slack channel to notify of an + alert trigger. Required. + "url": "str" # Slack Webhook URL. Required. + } + ] + }, + "period": "str", # Optional. Period of time the threshold must be exceeded + to trigger the alert. Known values are: "2m", "3m", "5m", "10m", "15m", "30m", + and "1h". + "threshold": 0, # Optional. The threshold at which the alert will enter a + trigger state. The specific threshold is dependent on the alert type. + "type": "str" # Optional. The type of alert. Known values are: "latency", + "down", "down_global", and "ssl_expiry". + } + # response body for status code(s): 200 response == { "alert": { @@ -140331,10 +148315,14 @@ def update_alert( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -140343,20 +148331,20 @@ def update_alert( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop( + content_type: Optional[str] = kwargs.pop( "content_type", _headers.pop("Content-Type", None) - ) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[JSON] + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: _json = body - request = build_uptime_update_alert_request( + _request = build_uptime_update_alert_request( check_id=check_id, alert_id=alert_id, content_type=content_type, @@ -140365,18 +148353,21 @@ def update_alert( headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) response_headers = {} @@ -140413,14 +148404,15 @@ def update_alert( deserialized = None if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return cast(JSON, deserialized) + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_alert( self, check_id: str, alert_id: str, **kwargs: Any ) -> Optional[JSON]: + # pylint: disable=line-too-long """Delete an Alert. To delete an Uptime alert, send a DELETE request to @@ -140450,10 +148442,14 @@ def delete_alert( tickets to help identify the issue. } """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response), + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), 429: HttpResponseError, 500: HttpResponseError, } @@ -140462,26 +148458,29 @@ def delete_alert( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) # type: ClsType[Optional[JSON]] + cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - request = build_uptime_delete_alert_request( + _request = build_uptime_delete_alert_request( check_id=check_id, alert_id=alert_id, headers=_headers, params=_params, ) - request.url = self._client.format_url(request.url) # type: ignore + _request.url = self._client.format_url(_request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [204, 404]: - map_error( - status_code=response.status_code, response=response, error_map=error_map - ) + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore raise HttpResponseError(response=response) deserialized = None @@ -140514,6 +148513,6 @@ def delete_alert( deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return deserialized # type: ignore diff --git a/tests/integration/shared.py b/tests/integration/shared.py index e5e0e728..4ceaef01 100644 --- a/tests/integration/shared.py +++ b/tests/integration/shared.py @@ -34,14 +34,13 @@ def wait_for_action(client: Client, action_id: int, wait_seconds: int = 5): raise IntegrationTestError( f"Error: {err.status_code} {err.reason}: {err.error.message}" ) from err - else: - status = resp["action"]["status"] - if status == "in-progress": - sleep(wait_seconds) - elif status == "errored": - raise Exception( - f"{resp['action']['type']} action {resp['action']['id']} {status}" - ) + status = resp["action"]["status"] + if status == "in-progress": + sleep(wait_seconds) + elif status == "errored": + raise ValueError( + f"{resp['action']['type']} action {resp['action']['id']} {status}" + ) def wait_for_status( @@ -71,13 +70,12 @@ def wait_for_status( raise IntegrationTestError( f"Error: {err.status_code} {err.reason}: {err.error.message}" ) from err - else: - resource = resp.get(resource_type) - status = resource.get(status_field) - if status == ready: - break - if status == errored: - raise Exception(f"Resource status: {status}") + resource = resp.get(resource_type) + status = resource.get(status_field) + if status == ready: + break + if status == errored: + raise ValueError(f"Resource status: {status}") if 0 < max_retries <= retry: return @@ -102,12 +100,11 @@ def wait_for_kubernetes_cluster_create( raise IntegrationTestError( f"Error: {err.status_code} {err.reason}: {err.error.message}" ) from err - else: - state = resp["kubernetes_cluster"]["status"]["state"] - if state == "running": - break - if state == "error": - raise Exception(f"Cluster {cluster_id} error status: {state}") + state = resp["kubernetes_cluster"]["status"]["state"] + if state == "running": + break + if state == "error": + raise ValueError(f"Cluster {cluster_id} error status: {state}") sleep(wait_seconds) return resp diff --git a/tests/mocked/test_client_customizations.py b/tests/mocked/test_client_customizations.py index 8b86f714..eabf6375 100644 --- a/tests/mocked/test_client_customizations.py +++ b/tests/mocked/test_client_customizations.py @@ -17,7 +17,7 @@ def test_custom_headers(): client = Client("", headers=custom_headers) # pylint: disable=protected-access - assert client._client._config.headers_policy.headers == custom_headers + assert client._config.headers_policy.headers == custom_headers def test_custom_timeout(): @@ -25,7 +25,7 @@ def test_custom_timeout(): client = Client("", timeout=timeout) # pylint: disable=protected-access - assert client._client._config.retry_policy.timeout == timeout + assert client._config.retry_policy.timeout == timeout def test_custom_endpoint(): @@ -42,7 +42,7 @@ def test_custom_logger(): client = Client("", logger=logger) # pylint: disable=protected-access - assert client._client._config.http_logging_policy.logger.name == name + assert client._config.http_logging_policy.logger.name == name @responses.activate @@ -59,7 +59,7 @@ def test_custom_user_agent(): full_user_agent_pattern = r"^test azsdk-python-pydo\/.+Python\/.+\(.+\)$" # pylint: disable=protected-access - got_user_agent = client._client._config.user_agent_policy.user_agent + got_user_agent = client._config.user_agent_policy.user_agent match = re.match(full_user_agent_pattern, got_user_agent) assert match is not None